common/exechelp: Fix error handling.
authorJustus Winter <justus@g10code.com>
Tue, 19 Jan 2016 12:09:06 +0000 (13:09 +0100)
committerJustus Winter <justus@g10code.com>
Tue, 23 Feb 2016 10:58:20 +0000 (11:58 +0100)
* common/exechelp-w32.c (gnupg_spawn_process): Close the right handle.

Signed-off-by: Justus Winter <justus@g10code.com>
common/exechelp-w32.c

index 7439c0b..1b3d072 100644 (file)
@@ -430,7 +430,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
           if (infp)
             es_fclose (infp);
           else if (inpipe[1] != INVALID_HANDLE_VALUE)
-            CloseHandle (outpipe[1]);
+            CloseHandle (inpipe[1]);
           if (inpipe[0] != INVALID_HANDLE_VALUE)
             CloseHandle (inpipe[0]);
           return err;
@@ -466,7 +466,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
           if (infp)
             es_fclose (infp);
           else if (inpipe[1] != INVALID_HANDLE_VALUE)
-            CloseHandle (outpipe[1]);
+            CloseHandle (inpipe[1]);
           if (inpipe[0] != INVALID_HANDLE_VALUE)
             CloseHandle (inpipe[0]);
           return err;