From 7bf058f0082d17b25b343782e3a33779cc7c956d Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Mon, 8 Aug 2005 22:46:13 +0400 Subject: [PATCH] [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 --- csum-file.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.30.2