summaryrefslogtreecommitdiff
path: root/lib/rpmte.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-03-21 09:07:21 +0200
committerPanu Matilainen <pmatilai@redhat.com>2012-03-21 09:07:21 +0200
commit2f20f6e6b2cc6f26794678d1db16659c484a001c (patch)
tree3f48221f5dc8a3d963880115223ca43ecda5a2d4 /lib/rpmte.c
parent274dbf557d1cac90f7c278f9b6d6af05997d92df (diff)
downloadrpm-2f20f6e6b2cc6f26794678d1db16659c484a001c.tar.gz
rpm-2f20f6e6b2cc6f26794678d1db16659c484a001c.tar.bz2
rpm-2f20f6e6b2cc6f26794678d1db16659c484a001c.zip
Transaction element file info can be legally NULL in some cases
- rpmteClose() will wipe out the file info to free memory, we only should care whether we failed to (re)load the file info. This thinko in commit 06a2f1269b035a3a76464149834f2a5a8c4e89f2 broke %posttrans scriptlets (and without commit 274dbf557d1cac90f7c278f9b6d6af05997d92df, %pretrans in other circumstances), whoopsie *blush*. Now, off to write a test-case for our scriptlet behavior...
Diffstat (limited to 'lib/rpmte.c')
-rw-r--r--lib/rpmte.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 65e1e766b..65d65afdd 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -693,11 +693,12 @@ static int rpmteOpen(rpmte te, int reload_fi)
}
if (h != NULL) {
if (reload_fi) {
+ /* This can fail if we get a different, bad header from callback */
te->fi = getFI(te, h);
+ rc = (te->fi != NULL);
+ } else {
+ rc = 1;
}
-
- /* This can fail if we get a different, bad header from callback */
- rc = (te->fi != NULL);
rpmteSetHeader(te, h);
headerFree(h);