Skip to content

Commit 02ab651

Browse files
committed
Fix crash
1 parent 61dba75 commit 02ab651

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

phlib/util.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,18 +2592,16 @@ NTSTATUS PhCreateProcessWin32Ex(
25922592
LocalFree(cmdlineArgList);
25932593
}
25942594

2595-
if (!RtlDoesFileExists_U(fileName->Buffer))
2595+
if (fileName && !RtlDoesFileExists_U(fileName->Buffer))
25962596
{
25972597
WCHAR buffer[MAX_PATH];
25982598

25992599
// The user typed a name without a path so attempt to locate the executable.
26002600
if (PhSearchFilePath(fileName->Buffer, L".exe", buffer))
26012601
PhMoveReference(&fileName, PhCreateString(buffer));
26022602
else
2603-
fileName = NULL;
2603+
PhClearReference(&fileName);
26042604
}
2605-
else
2606-
fileName = NULL;
26072605
}
26082606

26092607
newFlags = 0;

0 commit comments

Comments
 (0)