summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c075aea)
raw | patch | inline | side by side (parent: c075aea)
author | Carlos Rica <jasampler@gmail.com> | |
Fri, 25 May 2007 01:46:22 +0000 (03:46 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 25 May 2007 01:56:06 +0000 (18:56 -0700) |
When check_sha1_signature fails, program is not terminated:
it prints an error message and returns NULL, so the
buffer returned by read_sha1_file should be freed before.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
it prints an error message and returns NULL, so the
buffer returned by read_sha1_file should be freed before.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
object.c | patch | blob | history |
diff --git a/object.c b/object.c
index 78a44a6ef4e4823487861c9173f3db4a3fb76e3a..ccd7dd796e6b528d5cd08a04ba9d6105086035d6 100644 (file)
--- a/object.c
+++ b/object.c
if (buffer) {
struct object *obj;
if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) {
+ free(buffer);
error("sha1 mismatch %s\n", sha1_to_hex(sha1));
return NULL;
}