X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=diff.c;h=bb2a43b5b0725a5ef1896fcdd62e4d3e3ceccc04;hb=9d34c29db39bdb5c2443475dd6a24cfc5c2c9e37;hp=3e52fec18792056e230420bdeabff0f9dab5b35a;hpb=79db12e8ba74827724873beff2caeb6b85e0c6a9;p=git.git diff --git a/diff.c b/diff.c index 3e52fec1..bb2a43b5 100644 --- a/diff.c +++ b/diff.c @@ -405,14 +405,13 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only) return 0; } -void diff_free_filespec_data(struct diff_filespec *s) +void diff_free_filespec(struct diff_filespec *s) { if (s->should_free) free(s->data); else if (s->should_munmap) munmap(s->data, s->size); - s->should_free = s->should_munmap = 0; - s->data = NULL; + free(s); } static void prep_temp_blob(struct diff_tempfile *temp, @@ -769,8 +768,8 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *queue, void diff_free_filepair(struct diff_filepair *p) { - diff_free_filespec_data(p->one); - diff_free_filespec_data(p->two); + diff_free_filespec(p->one); + diff_free_filespec(p->two); free(p); }