summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-02-10 11:08:36 +1000
committerAllan McRae <allan@archlinux.org>2013-02-13 11:50:32 +1000
commitbafee395a661ae69e2987cf1d84d864013bbbf80 (patch)
treecb7d10cc55b56acc9e146b7eb958f3718a128d49
parent572b1a5de7a2e44bc269733870fbf0bfc5e6b5e7 (diff)
downloadpacman-bafee395a661ae69e2987cf1d84d864013bbbf80.tar.xz
Fix compilation error on clang
This also lead me to notice that in _alpm_gpgme_checksig many things were not being cleaned up. Fix this by having CHECK_ERR goto gpg_error and make the required adjustments. Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/signing.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index a57c9463..41d2e364 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -37,7 +37,7 @@
#if HAVE_LIBGPGME
#define CHECK_ERR(void) do { \
- if(gpg_err_code(err) != GPG_ERR_NO_ERROR) { goto error; } \
+ if(gpg_err_code(err) != GPG_ERR_NO_ERROR) { goto gpg_error; } \
} while(0)
/**
@@ -174,7 +174,7 @@ static int init_gpgme(alpm_handle_t *handle)
init = 1;
return 0;
-error:
+gpg_error:
_alpm_log(handle, ALPM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err));
RET_ERR(handle, ALPM_ERR_GPGME, -1);
}
@@ -215,8 +215,10 @@ int _alpm_key_in_keychain(alpm_handle_t *handle, const char *fpr)
}
gpgme_key_unref(key);
-error:
+gpg_error:
gpgme_release(ctx);
+
+error:
return ret;
}
@@ -279,9 +281,7 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
}
}
- if(gpg_err_code(err) != GPG_ERR_NO_ERROR) {
- goto error;
- }
+ CHECK_ERR();
/* should only get here if key actually exists */
pgpkey->data = key;
@@ -319,7 +319,7 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
ret = 1;
-error:
+gpg_error:
if(ret != 1) {
_alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
}
@@ -371,7 +371,7 @@ static int key_import(alpm_handle_t *handle, alpm_pgpkey_t *key)
ret = 0;
}
-error:
+gpg_error:
gpgme_release(ctx);
return ret;
}