aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 5f501864e..1cb1230a9 100644
--- a/diff.c
+++ b/diff.c
@@ -1493,9 +1493,9 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
/*
* Convert from working tree format to canonical git format
*/
- buf = s->data;
size = s->size;
- if (convert_to_git(s->path, &buf, &size)) {
+ buf = convert_to_git(s->path, s->data, &size);
+ if (buf) {
munmap(s->data, s->size);
s->should_munmap = 0;
s->data = buf;