1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +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:
Daniel Kahn Gillmor 2014-12-19 18:07:55 -05:00 committed by Werner Koch
parent 367b073ab5
commit b0b3803e8c

View File

@ -804,10 +804,8 @@ cmd_readkey (assuan_context_t ctx, char *line)
rc = ksba_cert_new (&kc);
if (rc)
{
xfree (cert);
goto leave;
}
goto leave;
rc = ksba_cert_init_from_mem (kc, cert, ncert);
if (rc)
{