From 9eef23fcf39f2b2eb2645afd31a79ba1286d9885 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 30 Oct 2018 11:19:33 +0100 Subject: [PATCH] w32: Fix previous commit. * src/w32-io.c (_gpgme_io_spawn): Move freeing of TMP_NAME behind its use in an error handling. Signed-off-by: Werner Koch --- src/w32-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/w32-io.c b/src/w32-io.c index d3b1b91f..52327afa 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -1678,9 +1678,6 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, return TRACE_SYSRES (-1); } - free (tmp_name); - free (arg_string); - if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) _gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId); @@ -1763,6 +1760,8 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, (hopefully). */ #endif + free (tmp_name); + free (arg_string); TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, " "dwProcessID=%d, dwThreadId=%d",