mirror of
https://github.com/reactos/reactos.git
synced 2025-07-15 16:24:02 +00:00
LoadLibraryExW: After loading a library as a datafile, clean up properly (don't leak SearchPath, and don't free DllName if we didn't allocate it)
svn path=/trunk/; revision=42163
This commit is contained in:
parent
c3f828c7ee
commit
91de7b5fd3
1 changed files with 2 additions and 8 deletions
|
@ -266,14 +266,7 @@ LoadLibraryExW (
|
|||
* 'native' libraries only
|
||||
*/
|
||||
Status = LoadLibraryAsDatafile(SearchPath, DllName.Buffer, &hInst);
|
||||
RtlFreeUnicodeString(&DllName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus(Status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return hInst;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,6 +285,7 @@ LoadLibraryExW (
|
|||
Status = LdrLoadDll(SearchPath, &dwFlags, &DllName, (PVOID*)&hInst);
|
||||
}
|
||||
|
||||
done:
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
|
||||
if (FreeString)
|
||||
RtlFreeUnicodeString(&DllName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue