From 4720571a2d6b27de32db3367817d71da0f9b0535 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 27 Dec 2006 15:36:36 +0100 Subject: [PATCH] Fix mkstemp emulation to not free the template string. The template argument was strduped unnecessarily and then not used, and the wrong string was freed. --- compat/mingw.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 67708e5fe0..ac4d4eb7fe 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -81,15 +81,10 @@ const char *inet_ntop(int af, const void *src, } int mkstemp (char *__template) { - char *temp = xstrdup(__template); char *filename = mktemp(__template); - int fd; - if (filename == NULL) return -1; - fd = open(filename, O_RDWR | O_CREAT); - free(filename); - return fd; + return open(filename, O_RDWR | O_CREAT); } int gettimeofday(struct timeval *tv, void *tz) {