From f82890983637db3b6d9fab8da2c2fedaf8b4c800 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 4 Feb 2010 05:09:38 +0000 Subject: fixed crash when checking signature while GnuPG is not available. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2453 ee746299-78ed-0310-b773-934348b2243d --- src/rfc2015.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/rfc2015.c') diff --git a/src/rfc2015.c b/src/rfc2015.c index 7bf195ff..432580e7 100644 --- a/src/rfc2015.c +++ b/src/rfc2015.c @@ -316,7 +316,8 @@ leave: gpgme_data_release(sig); gpgme_data_release(text); - gpgme_release(ctx); + if (ctx) + gpgme_release(ctx); if (prefs_common.gpg_signature_popup) gpgmegtk_sig_status_destroy(statuswindow); } @@ -436,7 +437,8 @@ static gpgme_data_t pgp_decrypt(MsgInfo *msginfo, MimeInfo *partinfo, FILE *fp) leave: gpgme_data_release(cipher); - gpgme_release(ctx); + if (ctx) + gpgme_release(ctx); return plain; } @@ -815,7 +817,8 @@ static gpgme_data_t pgp_encrypt(gpgme_data_t plain, gpgme_key_t kset[]) debug_print("** encryption succeeded\n"); } - gpgme_release(ctx); + if (ctx) + gpgme_release(ctx); return cipher; } @@ -1276,7 +1279,8 @@ leave: debug_print("signing succeeded\n"); } - gpgme_release(ctx); + if (ctx) + gpgme_release(ctx); return sig; } @@ -1352,7 +1356,8 @@ leave: debug_print("encryption and signing succeeded\n"); } - gpgme_release(ctx); + if (ctx) + gpgme_release(ctx); return cipher; } -- cgit v1.2.3