mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 19:13:38 +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
|
* 'native' libraries only
|
||||||
*/
|
*/
|
||||||
Status = LoadLibraryAsDatafile(SearchPath, DllName.Buffer, &hInst);
|
Status = LoadLibraryAsDatafile(SearchPath, DllName.Buffer, &hInst);
|
||||||
RtlFreeUnicodeString(&DllName);
|
goto done;
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastErrorByStatus(Status);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hInst;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,6 +285,7 @@ LoadLibraryExW (
|
||||||
Status = LdrLoadDll(SearchPath, &dwFlags, &DllName, (PVOID*)&hInst);
|
Status = LdrLoadDll(SearchPath, &dwFlags, &DllName, (PVOID*)&hInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, SearchPath);
|
||||||
if (FreeString)
|
if (FreeString)
|
||||||
RtlFreeUnicodeString(&DllName);
|
RtlFreeUnicodeString(&DllName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue