mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[winpr,path] fix NULL arguments for DeleteFile
This commit is contained in:
@@ -914,7 +914,7 @@ static BOOL shadow_server_init_certificate(rdpShadowServer* server)
|
||||
|
||||
if (!winpr_PathFileExists(filepath) && !winpr_PathMakePath(filepath, 0))
|
||||
{
|
||||
if (!CreateDirectoryA(filepath, 0))
|
||||
if (!winpr_PathMakePath(filepath, NULL))
|
||||
{
|
||||
WLog_ERR(TAG, "Failed to create directory '%s'", filepath);
|
||||
goto out_fail;
|
||||
|
||||
@@ -760,11 +760,10 @@ BOOL winpr_DeleteFile(const char* lpFileName)
|
||||
BOOL result = FALSE;
|
||||
|
||||
if (lpFileName)
|
||||
{
|
||||
lpFileNameW = ConvertUtf8ToWCharAlloc(lpFileName, NULL);
|
||||
if (!lpFileNameW)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!lpFileNameW)
|
||||
goto cleanup;
|
||||
|
||||
result = DeleteFileW(lpFileNameW);
|
||||
|
||||
@@ -783,11 +782,10 @@ BOOL winpr_RemoveDirectory(LPCSTR lpPathName)
|
||||
BOOL result = FALSE;
|
||||
|
||||
if (lpPathName)
|
||||
{
|
||||
lpPathNameW = ConvertUtf8ToWCharAlloc(lpPathName, NULL);
|
||||
if (!lpPathNameW)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!lpPathNameW)
|
||||
goto cleanup;
|
||||
|
||||
result = RemoveDirectoryW(lpPathNameW);
|
||||
|
||||
|
||||
@@ -1102,7 +1102,7 @@ int makecert_context_process(MAKECERT_CONTEXT* context, int argc, char** argv)
|
||||
{
|
||||
if (!winpr_PathFileExists(context->output_path))
|
||||
{
|
||||
if (!CreateDirectoryA(context->output_path, NULL))
|
||||
if (!winpr_PathMakePath(context->output_path, NULL))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user