зеркало из https://github.com/microsoft/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 <vsu@altlinux.ru> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
bfc66daf5c
Коммит
7bf058f008
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче