summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2019-10-24 15:38:50 +0200
committerAllan McRae <allan@archlinux.org>2019-10-27 10:05:27 +0100
commitae5cf26b5b5b92c9f68b5b29787e7d636f334c12 (patch)
treef197f4d4cc5459272e9e0cbdc974465ba4d1684a /lib/libalpm
parentdc55701132abf51de2f4289488f416a4c07afecf (diff)
downloadpacman-ae5cf26b5b5b92c9f68b5b29787e7d636f334c12.tar.gz
pacman-ae5cf26b5b5b92c9f68b5b29787e7d636f334c12.tar.xz
Fix segfault importing PGP key for pacman -U operations
Use after free. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/be_package.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index 0f45c331..5ffea875 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -760,14 +760,14 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful
pkg_temp = _alpm_pkg_load_internal(handle, filename, full);
if(pkg_temp) {
packager = pkg_temp->packager;
- _alpm_pkg_free(pkg_temp);
+
} else {
packager = NULL;
}
if(_alpm_key_import(handle, packager, key) == -1) {
fail = 1;
}
- free(packager);
+ _alpm_pkg_free(pkg_temp);
}
}
FREELIST(keys);