summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-24 20:25:48 +1000
committerAllan McRae <allan@archlinux.org>2015-03-03 16:54:17 +1000
commit2108d9552600bbfd7d7586dfebaa9750dec728ac (patch)
tree623ec5646efff2962cc477e045d6b8cada740467 /src
parent008bd33e38d666a2c034b8cde10fbabb801e4fc4 (diff)
downloadpacman-2108d9552600bbfd7d7586dfebaa9750dec728ac.tar.xz
Fix memory leaks in dump_pkg_full
Leaks when using -Sii with package signatures Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/package.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 14a7b9f0..33184bd5 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -201,6 +201,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
alpm_decode_signature(base64_sig, &decoded_sigdata, &data_len);
alpm_extract_keyid(config->handle, alpm_pkg_get_name(pkg),
decoded_sigdata, data_len, &keys);
+ free(decoded_sigdata);
} else {
keys = alpm_list_add(keys, _("None"));
}
@@ -208,6 +209,10 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
string_display(_("MD5 Sum :"), alpm_pkg_get_md5sum(pkg), cols);
string_display(_("SHA-256 Sum :"), alpm_pkg_get_sha256sum(pkg), cols);
list_display(_("Signatures :"), keys, cols);
+
+ if(base64_sig) {
+ FREELIST(keys);
+ }
} else {
list_display(_("Validated By :"), validation, cols);
}