diff options
Diffstat (limited to 'winpr/libwinpr/file')
-rw-r--r-- | winpr/libwinpr/file/generic.c | 3 | ||||
-rw-r--r-- | winpr/libwinpr/file/test/TestFileFindFirstFile.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/winpr/libwinpr/file/generic.c b/winpr/libwinpr/file/generic.c index 9318586..e7bc0cf 100644 --- a/winpr/libwinpr/file/generic.c +++ b/winpr/libwinpr/file/generic.c @@ -925,7 +925,10 @@ static WIN32_FILE_SEARCH* file_search_new(const char* name, size_t namelen, cons return pFileSearch; fail: + WINPR_PRAGMA_DIAG_PUSH + WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC FindClose(pFileSearch); + WINPR_PRAGMA_DIAG_POP return NULL; } diff --git a/winpr/libwinpr/file/test/TestFileFindFirstFile.c b/winpr/libwinpr/file/test/TestFileFindFirstFile.c index 04829a3..0e5de44 100644 --- a/winpr/libwinpr/file/test/TestFileFindFirstFile.c +++ b/winpr/libwinpr/file/test/TestFileFindFirstFile.c @@ -98,7 +98,8 @@ static BOOL find_first_file_success(const char* FilePath) } rc = TRUE; fail: - FindClose(hFind); + if (hFind != INVALID_HANDLE_VALUE) + FindClose(hFind); return rc; } |