[libfko] add ctx initialized check to fko_gpg_errstr()

This commit is contained in:
Michael Rash
2013-07-09 21:18:06 -04:00
parent bf2a8d5914
commit 5915ee72a9
+6
View File
@@ -210,6 +210,12 @@ const char*
fko_gpg_errstr(fko_ctx_t ctx)
{
#if HAVE_LIBGPGME
/* Must be initialized
*/
if(!CTX_INITIALIZED(ctx))
return("");
if(ctx->gpg_err)
return(gpgme_strerror(ctx->gpg_err));
#endif /* HAVE_LIBGPGME */