projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfc66da
)
[PATCH] Plug memory leak in sha1close()
author
Sergey Vlasov
<vsu@altlinux.ru>
Mon, 8 Aug 2005 18:46:13 +0000
(22:46 +0400)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 9 Aug 2005 05:51:46 +0000
(22:51 -0700)
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>
csum-file.c
patch
|
blob
|
history
diff --git
a/csum-file.c
b/csum-file.c
index 907efbf860152347bffe0cc999fdacad2a5f0724..c66b9eb10bfad8fee8b7b779cbb4a8e7c86480af 100644
(file)
--- 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;
}