mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
g10: Fix another memory leak.
* g10/skclist.c (enum_secret_keys): Use SK_LIST instead of pubkey_t. -- The use of pubkey_t was wrong. The use is just a list of keys, not with keyblock. With SK_LIST, release_sk_list releases memory by free_public_key. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
2eb481e8cc
commit
60c880bda5
@ -337,7 +337,7 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
|
||||
kbnode_t keyblock;
|
||||
kbnode_t node;
|
||||
getkey_ctx_t ctx;
|
||||
pubkey_t results;
|
||||
SK_LIST results;
|
||||
} *c = *context;
|
||||
|
||||
if (!c)
|
||||
@ -358,7 +358,7 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
|
||||
/* Free the context. */
|
||||
xfree (c->serialno);
|
||||
free_strlist (c->card_list);
|
||||
pubkeys_free (c->results);
|
||||
release_sk_list (c->results);
|
||||
release_kbnode (c->keyblock);
|
||||
getkey_end (ctrl, c->ctx);
|
||||
xfree (c);
|
||||
@ -516,7 +516,7 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
|
||||
if (c->node->pkt->pkttype == PKT_PUBLIC_KEY
|
||||
|| c->node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
|
||||
{
|
||||
pubkey_t r;
|
||||
SK_LIST r;
|
||||
|
||||
/* Skip this candidate if it's already enumerated. */
|
||||
for (r = c->results; r; r = r->next)
|
||||
@ -537,7 +537,6 @@ enum_secret_keys (ctrl_t ctrl, void **context, PKT_public_key *sk)
|
||||
}
|
||||
|
||||
r->pk = sk;
|
||||
r->keyblock = NULL;
|
||||
r->next = c->results;
|
||||
c->results = r;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user