From: Marcus Brinkmann Date: Thu, 13 Sep 2007 20:42:04 +0000 (+0000) Subject: 2007-09-13 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~131 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b19666695053b47470469aa87a09d852c12cb5de;p=gpgme.git 2007-09-13 Marcus Brinkmann * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes small memory leak). --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 4605d67..a496976 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2007-09-13 Marcus Brinkmann + + * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes + small memory leak). + 2007-09-07 Marcus Brinkmann * Makefile.am (libgpgme_qt_la_SOURCES): Move diff --git a/trunk/gpgme/rungpg.c b/trunk/gpgme/rungpg.c index a8fc8ad..70293f8 100644 --- a/trunk/gpgme/rungpg.c +++ b/trunk/gpgme/rungpg.c @@ -463,6 +463,8 @@ gpg_new (void **engine, const char *file_name, const char *home_dir) goto leave; rc = _gpgme_getenv ("DISPLAY", &dft_display); + if (rc) + goto leave; if (dft_display) { rc = add_arg (gpg, "--display"); @@ -471,8 +473,6 @@ gpg_new (void **engine, const char *file_name, const char *home_dir) free (dft_display); } - if (rc) - goto leave; if (isatty (1)) { @@ -489,7 +489,7 @@ gpg_new (void **engine, const char *file_name, const char *home_dir) if (!rc) { rc = _gpgme_getenv ("TERM", &dft_ttytype); - if (!rc) + if (rc) goto leave; rc = add_arg (gpg, "--ttytype");