summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64fdc08)
raw | patch | inline | side by side (parent: 64fdc08)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Tue, 10 Aug 2010 03:28:07 +0000 (22:28 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Aug 2010 16:57:43 +0000 (09:57 -0700) |
Noticed with valgrind.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index f1f789b7b87643245f1772d15b3f1cb321af324c..1f42473e8070a05ada8c56b0d60537227a5223ec 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
int size = ondisk_ce_size(ce);
struct ondisk_cache_entry *ondisk = xcalloc(1, size);
char *name;
+ int result;
ondisk->ctime.sec = htonl(ce->ce_ctime.sec);
ondisk->mtime.sec = htonl(ce->ce_mtime.sec);
name = ondisk->name;
memcpy(name, ce->name, ce_namelen(ce));
- return ce_write(c, fd, ondisk, size);
+ result = ce_write(c, fd, ondisk, size);
+ free(ondisk);
+ return result;
}
int write_index(struct index_state *istate, int newfd)