mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
lib/libalpm/util.c: Fix two memory leaks
Free "md5sum" if md5_file() fails in alpm_compute_md5sum(). Free "sha256sum" if sha2_file() fails in alpm_compute_sha256sum(). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
a12a4ea396
commit
0dad2f6e62
@ -836,6 +836,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
|
|||||||
ret = md5_file(filename, output);
|
ret = md5_file(filename, output);
|
||||||
|
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
|
free(md5sum);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -867,6 +868,7 @@ char SYMEXPORT *alpm_compute_sha256sum(const char *filename)
|
|||||||
ret = sha2_file(filename, output, 0);
|
ret = sha2_file(filename, output, 0);
|
||||||
|
|
||||||
if(ret > 0) {
|
if(ret > 0) {
|
||||||
|
free(sha256sum);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user