[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>
This commit is contained in:
parent
bfc66daf5c
commit
7bf058f008
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user