diff options
author | NIIBE Yutaka <[email protected]> | 2017-05-30 04:56:20 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2017-05-30 04:56:20 +0000 |
commit | 996544626ea416c173a940db47f47f9e5cbd844c (patch) | |
tree | 40ca4e161d0e75ee20aff03fbf6ada41c42cd7d9 /agent/divert-scd.c | |
parent | dirmngr: This towel should better detect a changed resolv.conf. (diff) | |
download | gnupg-996544626ea416c173a940db47f47f9e5cbd844c.tar.gz gnupg-996544626ea416c173a940db47f47f9e5cbd844c.zip |
agent: Fix memory leaks.
* agent/divert-scd.c (ask_for_card): Free WANT_KID and WANT_SN_DISP.
* agent/gpg-agent.c (create_server_socket): Free UNADDR.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'agent/divert-scd.c')
-rw-r--r-- | agent/divert-scd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c index 153119b38..88b35cd21 100644 --- a/agent/divert-scd.c +++ b/agent/divert-scd.c @@ -52,6 +52,7 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid) { rc = gpg_error_from_syserror (); xfree (want_sn); + xfree (want_kid); return rc; } @@ -84,6 +85,7 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid) serialno = NULL; if (!i) { + xfree (want_sn_disp); xfree (want_sn); *r_kid = want_kid; return 0; /* yes, we have the correct card */ @@ -122,9 +124,9 @@ ask_for_card (ctrl_t ctrl, const unsigned char *shadow_info, char **r_kid) else { rc = agent_get_confirmation (ctrl, desc, NULL, NULL, 0); - if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK && - gpg_err_code (rc) == GPG_ERR_NO_PIN_ENTRY) - rc = gpg_error (GPG_ERR_CARD_NOT_PRESENT); + if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK && + gpg_err_code (rc) == GPG_ERR_NO_PIN_ENTRY) + rc = gpg_error (GPG_ERR_CARD_NOT_PRESENT); xfree (desc); } |