Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-18 19:26:44 +0400
committerJunio C Hamano <gitster@pobox.com>2008-10-18 19:26:44 +0400
commit58e0fa5416c0a91761d904fd097c2ba9e45e3654 (patch)
tree595dd91831f6bd88448b62eea08a208346cd0814 /sha1_file.c
parentf4a75a416f62c0494e06cb42a11c7cc70ec9303e (diff)
parentf430c8e44d0548e844d817fc32be7c38b2b6856c (diff)
Merge branch 'maint'
* maint: Hopefully the final draft release notes update before 1.6.0.3 diff(1): clarify what "T"ypechange status means contrib: update packinfo.pl to not use dashed commands force_object_loose: Fix memory leak tests: shell negation portability fix
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 3fbb0820a0..70bb453be2 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2333,6 +2333,7 @@ int force_object_loose(const unsigned char *sha1, time_t mtime)
enum object_type type;
char hdr[32];
int hdrlen;
+ int ret;
if (has_loose_object(sha1))
return 0;
@@ -2340,7 +2341,10 @@ int force_object_loose(const unsigned char *sha1, time_t mtime)
if (!buf)
return error("cannot read sha1_file for %s", sha1_to_hex(sha1));
hdrlen = sprintf(hdr, "%s %lu", typename(type), len) + 1;
- return write_loose_object(sha1, hdr, hdrlen, buf, len, mtime);
+ ret = write_loose_object(sha1, hdr, hdrlen, buf, len, mtime);
+ free(buf);
+
+ return ret;
}
int has_pack_index(const unsigned char *sha1)