From 85a07ca7e3dffdefc8ae74beebb59e47a6e6bd1b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 15 Apr 2014 16:40:48 +0200 Subject: 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. --- src/w32-io.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/w32-io.c') 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", -- cgit v1.2.3