projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Add a new extended SHA1 syntax <name>~<num>
[git.git]
/
diff.c
diff --git
a/diff.c
b/diff.c
index
3e52fec
..
137d0d0
100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-405,14
+405,13
@@
int diff_populate_filespec(struct diff_filespec *s, int size_only)
return 0;
}
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);
{
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,
}
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)
{
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);
}
free(p);
}
@@
-1011,9
+1010,8
@@
void diff_flush(int diff_output_style, int line_termination)
diff_flush_name(p, line_termination);
break;
}
diff_flush_name(p, line_termination);
break;
}
- }
- for (i = 0; i < q->nr; i++)
diff_free_filepair(q->queue[i]);
diff_free_filepair(q->queue[i]);
+ }
free(q->queue);
q->queue = NULL;
q->nr = q->alloc = 0;
free(q->queue);
q->queue = NULL;
q->nr = q->alloc = 0;