Browse Source

Release GpgME context only if necessary.

Only attempt to release the GpgME context if it has been
initialized in the first place.
master
Damien Goutte-Gattat 2 years ago
parent
commit
d912418713
  1. 5
      src/yki.c

5
src/yki.c

@ -54,7 +54,7 @@ check_non_option_args(GOptionContext *parser, GOptionGroup *group, gpointer data
int
main(int argc, char **argv)
{
gpgme_ctx_t gpgme;
gpgme_ctx_t gpgme = NULL;
GError *error = NULL;
gboolean encrypt;
gchar **files;
@ -95,7 +95,8 @@ main(int argc, char **argv)
g_option_context_free(parser);
g_strfreev(files);
gpgme_release(gpgme);
if ( gpgme )
gpgme_release(gpgme);
return error ? EXIT_FAILURE : EXIT_SUCCESS;
}

Loading…
Cancel
Save