return 0;
}
-void diff_free_filespec(struct diff_filespec *s)
+void diff_free_filespec_data(struct diff_filespec *s)
{
if (s->should_free)
free(s->data);
else if (s->should_munmap)
munmap(s->data, s->size);
- free(s);
+ s->should_free = s->should_munmap = 0;
+ s->data = NULL;
}
static void prep_temp_blob(struct diff_tempfile *temp,
void diff_free_filepair(struct diff_filepair *p)
{
- diff_free_filespec(p->one);
- diff_free_filespec(p->two);
+ diff_free_filespec_data(p->one);
+ diff_free_filespec_data(p->two);
free(p);
}
dp = diff_queue(outq, d->one, c->two);
dp->score = p->score;
- diff_free_filespec(d->two);
- diff_free_filespec(c->one);
+ diff_free_filespec_data(d->two);
+ diff_free_filespec_data(c->one);
free(d);
free(c);
}
unsigned short);
extern int diff_populate_filespec(struct diff_filespec *, int);
-extern void diff_free_filespec(struct diff_filespec *);
+extern void diff_free_filespec_data(struct diff_filespec *);
struct diff_filepair {
struct diff_filespec *one;