aboutsummaryrefslogtreecommitdiffstats
path: root/src/key.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2013-02-06 16:35:40 +0000
committerWerner Koch <[email protected]>2013-02-06 16:35:40 +0000
commit51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c (patch)
treed431a193f5eece63dba5aa6485416e79f67396cb /src/key.c
parentImprove parsing of the GIT revision number. (diff)
downloadgpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.tar.gz
gpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.zip
Use gpg_error_from_syserror instead of directly accessing errno.
-- Also fixed a couple of minor thing; e.g. save the error before calling cleanup functions. Do not save the errno if only free is called in between.
Diffstat (limited to 'src/key.c')
-rw-r--r--src/key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/key.c b/src/key.c
index 1094f19b..59d49086 100644
--- a/src/key.c
+++ b/src/key.c
@@ -46,7 +46,7 @@ _gpgme_key_new (gpgme_key_t *r_key)
key = calloc (1, sizeof *key);
if (!key)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
key->_refs = 1;
*r_key = key;
@@ -61,7 +61,7 @@ _gpgme_key_add_subkey (gpgme_key_t key, gpgme_subkey_t *r_subkey)
subkey = calloc (1, sizeof *subkey);
if (!subkey)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
subkey->keyid = subkey->_keyid;
subkey->_keyid[16] = '\0';
@@ -215,7 +215,7 @@ _gpgme_key_append_name (gpgme_key_t key, const char *src, int convert)
size, so that we are able to store the parsed stuff there too. */
uid = malloc (sizeof (*uid) + 2 * src_len + 3);
if (!uid)
- return gpg_error_from_errno (errno);
+ return gpg_error_from_syserror ();
memset (uid, 0, sizeof *uid);
uid->uid = ((char *) uid) + sizeof (*uid);