1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

scd: avoid memory leaks

* scd/app-p15.c (send_certinfo): free labelbuf
  (do_sign): goto leave instead of return
* scd/app-piv.c (do_sign): goto leave instead of return, fix typo in
  variable name, avoid using uninitialized variables
* scd/command.c (cmd_genkey): goto leave instead of return

--

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
GnuPG-bug-id: 5393
This commit is contained in:
Jakub Jelen 2021-04-13 14:02:18 +02:00 committed by Werner Koch
parent fc5fac83b7
commit 27e7bde12e
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 14 additions and 7 deletions

View file

@ -1438,7 +1438,10 @@ cmd_genkey (assuan_context_t ctx, char *line)
line = skip_options (line);
if (!*line)
return set_error (GPG_ERR_ASS_PARAMETER, "no key number given");
{
err = set_error (GPG_ERR_ASS_PARAMETER, "no key number given");
goto leave;
}
keyref = line;
while (*line && !spacep (line))
line++;
@ -1448,7 +1451,10 @@ cmd_genkey (assuan_context_t ctx, char *line)
goto leave;
if (!ctrl->card_ctx)
return gpg_error (GPG_ERR_UNSUPPORTED_OPERATION);
{
err = gpg_error (GPG_ERR_UNSUPPORTED_OPERATION);
goto leave;
}
keyref = keyref_buffer = xtrystrdup (keyref);
if (!keyref)