Fix memory leaks in rpmGetSubkeys() and pgpPrtParamsSubkeys()
This commit is contained in:
parent
468726ece5
commit
cc61141245
|
@ -177,6 +177,7 @@ rpmPubkey *rpmGetSubkeys(rpmPubkey mainkey, int *count)
|
|||
subkey->nrefs = 1;
|
||||
pthread_rwlock_init(&subkey->lock, NULL);
|
||||
}
|
||||
free(pgpsubkeys);
|
||||
}
|
||||
*count = pgpsubkeysCount;
|
||||
|
||||
|
|
|
@ -1022,8 +1022,10 @@ int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen,
|
|||
/* Copy UID from main key to subkey */
|
||||
digps[count]->userid = xstrdup(mainkey->userid);
|
||||
|
||||
if(getFingerprint(pkt.body, pkt.blen, digps[count]->signid))
|
||||
if(getFingerprint(pkt.body, pkt.blen, digps[count]->signid)) {
|
||||
pgpDigParamsFree(digps[count]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(pgpPrtKey(pkt.tag, pkt.body, pkt.blen, digps[count])) {
|
||||
pgpDigParamsFree(digps[count]);
|
||||
|
|
Loading…
Reference in New Issue