From: Sergey Vlasov Date: Mon, 8 Aug 2005 18:46:13 +0000 (+0400) Subject: [PATCH] Plug memory leak in sha1close() X-Git-Tag: v0.99.4~5^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7bf058f0082d17b25b343782e3a33779cc7c956d;p=git.git [PATCH] Plug memory leak in sha1close() sha1create() and sha1fd() malloc the returned struct sha1file; sha1close() should free it. Signed-off-by: Sergey Vlasov Signed-off-by: Junio C Hamano --- diff --git a/csum-file.c b/csum-file.c index 907efbf86..c66b9eb10 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; }