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
1 changed files with 2 additions and 4 deletions

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)
{