mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 12:23:30 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user