summaryrefslogtreecommitdiff
path: root/lib/rpmchecksig.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-03-10 11:03:08 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-03-10 11:03:08 +0200
commit05e16d415492f4925782e3fcf6ef155cbdf124c3 (patch)
tree8915e3a28d83f5b1258bb0f25b8d6e0d445cad4d /lib/rpmchecksig.c
parent493913ed415acf8be26b13a785a9615ba5cb6981 (diff)
downloadlibrpm-tizen-05e16d415492f4925782e3fcf6ef155cbdf124c3.tar.gz
librpm-tizen-05e16d415492f4925782e3fcf6ef155cbdf124c3.tar.bz2
librpm-tizen-05e16d415492f4925782e3fcf6ef155cbdf124c3.zip
Fix memleak on signature checking failure
- early exit from header iteration loop could previously leak from unfreed buf and header iterator
Diffstat (limited to 'lib/rpmchecksig.c')
-rw-r--r--lib/rpmchecksig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 4c02c4170..7f1425263 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -552,7 +552,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
pgpDig dig = NULL;
pgpDigParams sigp;
Header sigh = NULL;
- HeaderIterator hi;
+ HeaderIterator hi = NULL;
char * msg;
int res = 0;
int xx;
@@ -749,7 +749,6 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
free(msg);
buf = b;
}
- hi = headerFreeIterator(hi);
res += failed;
@@ -765,12 +764,13 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
untrustedKeys ? untrustedKeys : "",
untrustedKeys ? _(")") : "");
}
- free(buf);
free(missingKeys);
free(untrustedKeys);
exit:
+ free(buf);
sigh = rpmFreeSignature(sigh);
+ hi = headerFreeIterator(hi);
rpmKeyringFree(keyring);
pgpFreeDig(dig);
return res;