diff options
author | Andre Heinecke <[email protected]> | 2018-10-29 18:44:02 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-10-29 18:44:02 +0000 |
commit | 7a1b58045f980c4df76daf225a2a1b604e8604d2 (patch) | |
tree | 9611a99d5ac76b9ca8b564cfea93ed5c453fc7a3 /src/w32-io.c | |
parent | tests: Add repeat argument to run-verify (diff) | |
download | gpgme-7a1b58045f980c4df76daf225a2a1b604e8604d2.tar.gz gpgme-7a1b58045f980c4df76daf225a2a1b604e8604d2.zip |
core,w32: Fix memleak of tmp_name in w32-io
* src/w32-io.c (_gpgme_io_spawn): Free tmp_name.
--
GnuPG-Bug-Id: T4238
Diffstat (limited to 'src/w32-io.c')
-rw-r--r-- | src/w32-io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/w32-io.c b/src/w32-io.c index 05e11ee8..d3b1b91f 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -1610,6 +1610,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, { close (tmp_fd); DeleteFileA (tmp_name); + free (tmp_name); return TRACE_SYSRES (-1); } @@ -1649,6 +1650,9 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, MessageBoxA (NULL, msg, "GpgME not installed correctly", MB_OK); gpgrt_free (msg); gpg_err_set_errno (EIO); + close (tmp_fd); + DeleteFileA (tmp_name); + free (tmp_name); return TRACE_SYSRES (-1); } if (!CreateProcessA (spawnhelper, @@ -1667,12 +1671,14 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, free (arg_string); close (tmp_fd); DeleteFileA (tmp_name); + free (tmp_name); /* FIXME: Should translate the error code. */ gpg_err_set_errno (EIO); return TRACE_SYSRES (-1); } + free (tmp_name); free (arg_string); if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) @@ -1702,6 +1708,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, close (tmp_fd); DeleteFileA (tmp_name); + free (tmp_name); /* FIXME: Should translate the error code. */ gpg_err_set_errno (EIO); |