mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-26 22:29:58 +01:00
g10: Fix memory leak for PKT_signature.
* g10/getkey.c (buf_to_sig): Free by free_seckey_enc. * g10/gpgcompose.c (signature): Likewise. * g10/sign.c (write_signature_packets): Likewise. -- Cherry picked from master commit: 996febbab21eb9283b0634e51303a36b318734a6 Reported-by: Philippe Antoine GnuPG-bug-id: 4047 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
cca92ca534
commit
2809be1f97
@ -3128,7 +3128,7 @@ buf_to_sig (const byte * buf, size_t len)
|
|||||||
|
|
||||||
if (parse_signature (iobuf, PKT_SIGNATURE, len, sig) != 0)
|
if (parse_signature (iobuf, PKT_SIGNATURE, len, sig) != 0)
|
||||||
{
|
{
|
||||||
xfree (sig);
|
free_seckey_enc (sig);
|
||||||
sig = NULL;
|
sig = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1835,7 +1835,7 @@ signature (const char *option, int argc, char *argv[], void *cookie)
|
|||||||
debug ("Wrote signature packet:\n");
|
debug ("Wrote signature packet:\n");
|
||||||
dump_component (&pkt);
|
dump_component (&pkt);
|
||||||
|
|
||||||
xfree (sig);
|
free_seckey_enc (sig);
|
||||||
release_kbnode (si.issuer_kb);
|
release_kbnode (si.issuer_kb);
|
||||||
xfree (si.revocation_key);
|
xfree (si.revocation_key);
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ write_signature_packets (ctrl_t ctrl,
|
|||||||
gpg_strerror (rc));
|
gpg_strerror (rc));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xfree (sig);
|
free_seckey_enc (sig);
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user