1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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.
This commit is contained in:
Werner Koch 2020-10-26 12:49:21 +01:00
parent cf4b8a27c3
commit 0f780b1aeb
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 6 additions and 5 deletions

View file

@ -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;