aboutsummaryrefslogtreecommitdiff
path: root/src/rfc2015.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-04 05:09:38 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-02-04 05:09:38 +0000
commitf82890983637db3b6d9fab8da2c2fedaf8b4c800 (patch)
treeddd4f4846424fd4279df1390e3da26e31231be56 /src/rfc2015.c
parent0f5e09dd70529b40cbe9ada65aabac319e5513ff (diff)
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
Diffstat (limited to 'src/rfc2015.c')
-rw-r--r--src/rfc2015.c15
1 files changed, 10 insertions, 5 deletions
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;
}