summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d75f795)
raw | patch | inline | side by side (parent: d75f795)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 13 Apr 2006 23:09:48 +0000 (01:09 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 13 Apr 2006 23:50:02 +0000 (16:50 -0700) |
... and a fix for an invalid free():
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index 14ffc774f07b843c1d5f8b1370816c06cf536abf..c120239ef34b150e3d4b94b6815714a8a0c33e23 100644 (file)
--- a/diff.c
+++ b/diff.c
char *qname = xmalloc(len + 1);
quote_c_style(name, qname, NULL, 0);
free(name);
- name = qname;
+ data->files[i]->name = name = qname;
}
/*
if (added < 0) {
/* binary file */
printf(" %s%-*s | Bin\n", prefix, len, name);
- continue;
+ goto free_diffstat_file;
} else if (added + deleted == 0) {
total_files--;
- continue;
+ goto free_diffstat_file;
}
add = added;
add = (add * max + max_change / 2) / max_change;
del = total - add;
}
- /* TODO: binary */
printf(" %s%-*s |%5d %.*s%.*s\n", prefix,
len, name, added + deleted,
add, pluses, del, minuses);
- free(name);
+ free_diffstat_file:
+ free(data->files[i]->name);
free(data->files[i]);
}
free(data->files);