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:
authorSergey Vlasov <vsu@altlinux.ru>2005-08-08 22:46:13 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-09 09:51:46 +0400
commit7bf058f0082d17b25b343782e3a33779cc7c956d (patch)
tree1e3553faba35854f539d5dd6edd0def954e93f02 /csum-file.c
parentbfc66daf5c0dcb1a507ff2533760ac5505eee6a3 (diff)
[PATCH] Plug memory leak in sha1close()
sha1create() and sha1fd() malloc the returned struct sha1file; sha1close() should free it. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'csum-file.c')
-rw-r--r--csum-file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/csum-file.c b/csum-file.c
index 907efbf860..c66b9eb10b 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -45,6 +45,7 @@ int sha1close(struct sha1file *f, unsigned char *result, int update)
sha1flush(f, 20);
if (close(f->fd))
die("%s: sha1 file error on close (%s)", f->name, strerror(errno));
+ free(f);
return 0;
}