mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
DRIVER_RegisterDriver did not check for NULL pointer when it alloc memory.
svn path=/trunk/; revision=20418
This commit is contained in:
parent
4da89d0391
commit
677cdc30d5
1 changed files with 7 additions and 0 deletions
|
@ -54,6 +54,13 @@ BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver)
|
||||||
Driver->Name = ExAllocatePoolWithTag(PagedPool,
|
Driver->Name = ExAllocatePoolWithTag(PagedPool,
|
||||||
(wcslen(Name) + 1) * sizeof(WCHAR),
|
(wcslen(Name) + 1) * sizeof(WCHAR),
|
||||||
TAG_DRIVER);
|
TAG_DRIVER);
|
||||||
|
if (Driver->Name == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Out of memory\n");
|
||||||
|
ExFreePool(Driver);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
wcscpy(Driver->Name, Name);
|
wcscpy(Driver->Name, Name);
|
||||||
Driver->Next = DriverList;
|
Driver->Next = DriverList;
|
||||||
DriverList = Driver;
|
DriverList = Driver;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue