aboutsummaryrefslogtreecommitdiffstats
path: root/common/exechelp-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/exechelp-posix.c')
-rw-r--r--common/exechelp-posix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
index 0c09abbf4..7a4f9e251 100644
--- a/common/exechelp-posix.c
+++ b/common/exechelp-posix.c
@@ -1529,8 +1529,14 @@ gnupg_process_wait (gnupg_process_t process, int hang)
void
gnupg_process_release (gnupg_process_t process)
{
+ if (!process)
+ return;
+
if (process->terminated)
- gnupg_process_wait (process, 0);
+ {
+ gnupg_process_terminate (process);
+ gnupg_process_wait (process, 1);
+ }
xfree (process);
}