diff options
author | Werner Koch <wk@gnupg.org> | 2017-12-13 10:52:34 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-12-13 10:52:34 +0100 |
commit | cd26c5482b10bee7658959ae913f2ddb83190587 (patch) | |
tree | f57eb9c03f12f92eb15fd41485e04c5dc680993b /g10/revoke.c | |
parent | gpg: Remove some xmallocs. (diff) | |
download | gnupg2-cd26c5482b10bee7658959ae913f2ddb83190587.tar.xz gnupg2-cd26c5482b10bee7658959ae913f2ddb83190587.zip |
gpg: Return an error from hexfingerprint on malloc error.
* g10/keyid.c (hexfingerprint): Return NULL on malloc failure. Chnage
all callers.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/revoke.c')
-rw-r--r-- | g10/revoke.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/g10/revoke.c b/g10/revoke.c index 457870082..846523295 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -536,7 +536,20 @@ gen_standard_revoke (ctrl_t ctrl, PKT_public_key *psk, const char *cache_nonce) dir = get_openpgp_revocdir (gnupg_homedir ()); tmpstr = hexfingerprint (psk, NULL, 0); - fname = xstrconcat (dir, DIRSEP_S, tmpstr, NULL); + if (!tmpstr) + { + rc = gpg_error_from_syserror (); + xfree (dir); + return rc; + } + fname = strconcat (dir, DIRSEP_S, tmpstr, NULL); + if (!fname) + { + rc = gpg_error_from_syserror (); + xfree (tmpstr); + xfree (dir); + return rc; + } xfree (tmpstr); xfree (dir); |