Browse Source

[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>
maint
Sergey Vlasov 20 years ago committed by Junio C Hamano
parent
commit
7bf058f008
  1. 1
      csum-file.c

1
csum-file.c

@ -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);
if (close(f->fd))
die("%s: sha1 file error on close (%s)", f->name, strerror(errno));
free(f);
return 0;
}


Loading…
Cancel
Save