mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 02:13:29 +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
|
@ -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…
Reference in a new issue