Skip to content
Snippets Groups Projects
Commit 7bf058f0 authored by Sergey Vlasov's avatar Sergey Vlasov Committed by Junio C Hamano
Browse files

[PATCH] Plug memory leak in sha1close()


sha1create() and sha1fd() malloc the returned struct sha1file;
sha1close() should free it.

Signed-off-by: default avatarSergey Vlasov <vsu@altlinux.ru>
Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
parent bfc66daf
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ int sha1close(struct sha1file *f, unsigned char *result, int update) ...@@ -45,6 +45,7 @@ int sha1close(struct sha1file *f, unsigned char *result, int update)
sha1flush(f, 20); sha1flush(f, 20);
if (close(f->fd)) if (close(f->fd))
die("%s: sha1 file error on close (%s)", f->name, strerror(errno)); die("%s: sha1 file error on close (%s)", f->name, strerror(errno));
free(f);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment