From 51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 6 Feb 2013 17:35:40 +0100 Subject: 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. --- src/trustlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/trustlist.c') diff --git a/src/trustlist.c b/src/trustlist.c index ca7d7ee0..d4567805 100644 --- a/src/trustlist.c +++ b/src/trustlist.c @@ -111,9 +111,9 @@ trustlist_colon_handler (void *priv, char *line) item->name = strdup (p); if (!item->name) { - int saved_errno = errno; + int saved_err = gpg_error_from_syserror (); gpgme_trust_item_unref (item); - return gpg_error_from_errno (saved_errno); + return saved_err; } break; } -- cgit v1.2.3