git-am: use printf instead of echo on user-supplied strings
[gitweb.git] / object.c
index 78a44a6ef4e4823487861c9173f3db4a3fb76e3a..ccd7dd796e6b528d5cd08a04ba9d6105086035d6 100644 (file)
--- a/object.c
+++ b/object.c
@@ -185,6 +185,7 @@ struct object *parse_object(const unsigned char *sha1)
        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;
                }