summaryrefslogtreecommitdiffstats
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-10-26 12:49:21 +0100
committerWerner Koch <wk@gnupg.org>2020-10-26 12:50:30 +0100
commit0f780b1aebb1b1bde219401735a1c24c1f0a7978 (patch)
tree1a135a0114f49daee6d2c5c3cc6234173a781372 /g10/call-agent.c
parentg10,sm: Use gnupg_access at two more places (diff)
downloadgnupg2-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.c1
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;