diff --git a/src/w32-io.c b/src/w32-io.c index 634ecb32..d00b8db3 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -794,6 +794,7 @@ create_writer (int fd) if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used) { TRACE_SYSERR (EIO); + free (ctx); return NULL; } TRACE_LOG4 ("fd=%d -> handle=%p socket=%d dupfrom=%d", 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;