diff options
Diffstat (limited to 'gpgme/rungpg.c')
-rw-r--r-- | gpgme/rungpg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 616ff3d7..50223c19 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -503,6 +503,7 @@ gpg_set_command_handler (void *engine, engine_command_handler_t fnc, static gpgme_error_t build_argv (engine_gpg_t gpg) { + gpgme_error_t err; struct arg_and_data_s *a; struct fd_data_map_s *fd_data_map; size_t datac=0, argc=0; @@ -514,9 +515,13 @@ build_argv (engine_gpg_t gpg) /* We don't want to use the agent with a malformed environment variable. This is only a very basic test but sufficient to make our life in the regression tests easier. */ - p = getenv ("GPG_AGENT_INFO"); + err = _gpgme_getenv ("GPG_AGENT_INFO", &p); + if (err) + return err; use_agent = (p && strchr (p, ':')); - + if (p) + free (p); + if (gpg->argv) { free_argv (gpg->argv); |