summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-08-26 13:10:38 +0200
committerDan McGee <dan@archlinux.org>2011-08-28 19:49:02 -0500
commit0dad2f6e6223e2aa00c43b59f49bf83082a0d6bb (patch)
tree01099a0a509fc9645b6435c6d56a47072b1a1f78 /lib/libalpm
parenta12a4ea3960c98817aa60df5a8879d118a16e2a7 (diff)
downloadpacman-0dad2f6e6223e2aa00c43b59f49bf83082a0d6bb.tar.xz
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>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index cf783893..98eaa175 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -836,6 +836,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
ret = md5_file(filename, output);
if(ret > 0) {
+ free(md5sum);
return NULL;
}
@@ -867,6 +868,7 @@ char SYMEXPORT *alpm_compute_sha256sum(const char *filename)
ret = sha2_file(filename, output, 0);
if(ret > 0) {
+ free(sha256sum);
return NULL;
}