aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32-util.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-04-15 14:40:48 +0000
committerWerner Koch <[email protected]>2014-04-15 20:18:04 +0000
commit85a07ca7e3dffdefc8ae74beebb59e47a6e6bd1b (patch)
tree7a8e1fd5fac17a3772986b6e4efde3cc26455dca /src/w32-util.c
parentFix possible zombie processes. (diff)
downloadgpgme-85a07ca7e3dffdefc8ae74beebb59e47a6e6bd1b.tar.gz
gpgme-85a07ca7e3dffdefc8ae74beebb59e47a6e6bd1b.zip
w32: Fix memleak in an error code paths.
* src/w32-io.c (create_writer): Free CTX in cased of bad FD. * src/w32-util.c (_gpgme_mkstemp): Free TMPNAME in case of a failed mkstemp. -- Found by Hans-Christoph Steiner with cppcheck.
Diffstat (limited to 'src/w32-util.c')
-rw-r--r--src/w32-util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/w32-util.c b/src/w32-util.c
index 3884b40d..daf3bd2d 100644
--- a/src/w32-util.c
+++ b/src/w32-util.c
@@ -710,7 +710,10 @@ _gpgme_mkstemp (int *fd, char **name)
strcpy (stpcpy (tmpname, tmp), "\\gpgme-XXXXXX");
*fd = mkstemp (tmpname);
if (fd < 0)
- return -1;
+ {
+ free (tmpname);
+ return -1;
+ }
*name = tmpname;
return 0;