lib: Define and use cleanup functions for gpgme

Just a cleanup in preparation for future work.

Closes: #575
Approved by: giuseppe
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-11-17 09:44:07 +00:00
1 parent bd45e7ac19
commit a6cfe62eb8
3 files changed
+12 -23

No files matched your search

+3 -12
View File
@@ -1440,9 +1440,9 @@ ostree_repo_remote_gpg_import (OstreeRepo *self,
GError **error)
{
OstreeRemote *remote;
gpgme_ctx_t source_context = NULL;
gpgme_ctx_t target_context = NULL;
gpgme_data_t data_buffer = NULL;
ot_auto_gpgme_ctx gpgme_ctx_t source_context = NULL;
ot_auto_gpgme_ctx gpgme_ctx_t target_context = NULL;
ot_auto_gpgme_data gpgme_data_t data_buffer = NULL;
gpgme_import_result_t import_result;
gpgme_import_status_t import_status;
const char *tmp_dir = NULL;
@@ -1700,15 +1700,6 @@ out:
if (target_tmp_dir != NULL)
(void) glnx_shutil_rm_rf_at (AT_FDCWD, target_tmp_dir, NULL, NULL);
if (source_context != NULL)
gpgme_release (source_context);
if (target_context != NULL)
gpgme_release (target_context);
if (data_buffer != NULL)
gpgme_data_release (data_buffer);
g_prefix_error (error, "GPG: ");
return ret;