1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-04 06:36:35 +02:00

[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:
Sergey Vlasov 2005-08-08 22:46:13 +04:00 committed by Junio C Hamano
parent bfc66daf5c
commit 7bf058f008

View File

@ -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;
}