mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-04 20:38:50 +01:00
scd: Avoid double-free on error condition in scd
* scd/command.c (cmd_readkey): avoid double-free of cert -- When ksba_cert_new() fails, cert will be double-freed. Debian-Bug-Id: 773471 Original patch changed by wk to do the free only at leave.
This commit is contained in:
parent
1fc4dc541a
commit
0fd4cd8503
@ -777,10 +777,8 @@ cmd_readkey (assuan_context_t ctx, char *line)
|
|||||||
|
|
||||||
rc = ksba_cert_new (&kc);
|
rc = ksba_cert_new (&kc);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
|
||||||
xfree (cert);
|
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
|
||||||
rc = ksba_cert_init_from_mem (kc, cert, ncert);
|
rc = ksba_cert_init_from_mem (kc, cert, ncert);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user