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/import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/import.c') diff --git a/src/import.c b/src/import.c index d4edaba1..6233a155 100644 --- a/src/import.c +++ b/src/import.c @@ -174,9 +174,8 @@ parse_import (char *args, gpgme_import_status_t *import_status, int problem) import->fpr = strdup (args); if (!import->fpr) { - int saved_errno = errno; free (import); - return gpg_error_from_errno (saved_errno); + return gpg_error_from_syserror (); } *import_status = import; -- cgit v1.2.3