diff options
Diffstat (limited to 'libraries/base/cbits/Win32Utils.c')
-rw-r--r-- | libraries/base/cbits/Win32Utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libraries/base/cbits/Win32Utils.c b/libraries/base/cbits/Win32Utils.c index e886cceb9f..f3dec0d98d 100644 --- a/libraries/base/cbits/Win32Utils.c +++ b/libraries/base/cbits/Win32Utils.c @@ -170,6 +170,7 @@ BOOL file_exists(LPCTSTR path) bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix, wchar_t* suffix, wchar_t** tempFileName) { + *tempFileName = NULL; int retry = 5; bool success = false; while (retry-- > 0 && !success) @@ -215,6 +216,9 @@ bool __createUUIDTempFileErrNo (wchar_t* pathName, wchar_t* prefix, return success; fail: + if (*tempFileName != NULL) { + free (*tempFileName); + } maperrno(); return false; } |