diff options
author | Werner Koch <wk@gnupg.org> | 2020-10-26 12:49:21 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-10-26 12:50:30 +0100 |
commit | 0f780b1aebb1b1bde219401735a1c24c1f0a7978 (patch) | |
tree | 1a135a0114f49daee6d2c5c3cc6234173a781372 /g10/call-agent.c | |
parent | g10,sm: Use gnupg_access at two more places (diff) | |
download | gnupg2-0f780b1aebb1b1bde219401735a1c24c1f0a7978.tar.xz gnupg2-0f780b1aebb1b1bde219401735a1c24c1f0a7978.zip |
g10: Make call to agent_scd_serialno more robust.
* g10/call-agent.c (agent_scd_serialno): Make sure that NULL is stored
on error at r_serialno.
* g10/card-util.c (card_status): Simplify freeing of seriaono.
(factory_reset): Ditto.
--
This pattern is what we use with other functions returning an
allocated string and thus less surprising.
Diffstat (limited to 'g10/call-agent.c')
-rw-r--r-- | g10/call-agent.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c index 1fa77e7be..c4d146392 100644 --- a/g10/call-agent.c +++ b/g10/call-agent.c @@ -1381,6 +1381,7 @@ agent_scd_serialno (char **r_serialno, const char *demand) char *serialno = NULL; char line[ASSUAN_LINELENGTH]; + *r_serialno = NULL; err = start_agent (NULL, (1 | FLAG_FOR_CARD_SUPPRESS_ERRORS)); if (err) return err; |