summaryrefslogtreecommitdiffstats
path: root/winpr/libwinpr/path/path.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
commit827a4c3faa27e0c186452585b15094eee1119085 (patch)
treee6a08b0c767863d66f7d4a9de80db5edc7db29be /winpr/libwinpr/path/path.c
parentReleasing progress-linux version 3.3.0+dfsg1-1~progress7.99u1. (diff)
downloadfreerdp3-827a4c3faa27e0c186452585b15094eee1119085.tar.xz
freerdp3-827a4c3faa27e0c186452585b15094eee1119085.zip
Merging upstream version 3.5.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'winpr/libwinpr/path/path.c')
-rw-r--r--winpr/libwinpr/path/path.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/winpr/libwinpr/path/path.c b/winpr/libwinpr/path/path.c
index 82e6be1..3f20465 100644
--- a/winpr/libwinpr/path/path.c
+++ b/winpr/libwinpr/path/path.c
@@ -1002,7 +1002,7 @@ PCSTR PathGetSharedLibraryExtensionA(unsigned long dwFlags)
PCWSTR PathGetSharedLibraryExtensionW(unsigned long dwFlags)
{
- WCHAR buffer[6][16] = { 0 };
+ static WCHAR buffer[6][16] = { 0 };
const WCHAR* SharedLibraryExtensionDotDllW = InitializeConstWCharFromUtf8(
SharedLibraryExtensionDotDllA, buffer[0], ARRAYSIZE(buffer[0]));
const WCHAR* SharedLibraryExtensionDotSoW =
@@ -1131,11 +1131,12 @@ BOOL winpr_RemoveDirectory_RecursiveW(LPCWSTR lpPathName)
WCHAR starbuffer[8] = { 0 };
const WCHAR* star = InitializeConstWCharFromUtf8("*", starbuffer, ARRAYSIZE(starbuffer));
const HRESULT hr = NativePathCchAppendW(path_slash, path_slash_len, star);
+ HANDLE dir = INVALID_HANDLE_VALUE;
if (FAILED(hr))
goto fail;
WIN32_FIND_DATAW findFileData = { 0 };
- HANDLE dir = FindFirstFileW(path_slash, &findFileData);
+ dir = FindFirstFileW(path_slash, &findFileData);
if (dir == INVALID_HANDLE_VALUE)
goto fail;
@@ -1167,8 +1168,6 @@ BOOL winpr_RemoveDirectory_RecursiveW(LPCWSTR lpPathName)
break;
} while (ret && FindNextFileW(dir, &findFileData) != 0);
- FindClose(dir);
-
if (ret)
{
if (!RemoveDirectoryW(lpPathName))
@@ -1176,6 +1175,7 @@ BOOL winpr_RemoveDirectory_RecursiveW(LPCWSTR lpPathName)
}
fail:
+ FindClose(dir);
free(path_slash);
return ret;
}