Author: tkreuzer
Date: Tue Nov 12 19:23:42 2013
New Revision: 60965
URL: http://svn.reactos.org/svn/reactos?rev=60965&view=rev
Log:
[NTOSKRNL]
Fix freeing of the driver string, this should only be done, if the lowest bit is set.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Tue Nov 12 19:23:42 2013
@@ -3214,11 +3214,20 @@
&LoadedImports);
if (!NT_SUCCESS(Status))
{
+ BOOLEAN NeedToFreeString = FALSE;
+
+ /* If the lowest bit is set to 1, this is a hint that we need to free */
+ if (*(ULONG_PTR*)MissingDriverName & 1)
+ {
+ NeedToFreeString = TRUE;
+ *(ULONG_PTR*)MissingDriverName &= ~1;
+ }
+
DPRINT1("MiResolveImageReferences failed with status 0x%x\n", Status);
DPRINT1(" Missing driver '%ws', missing API '%s'\n",
MissingDriverName, MissingApiName);
- if (MissingDriverName != NULL)
+ if (NeedToFreeString)
{
ExFreePoolWithTag(MissingDriverName, TAG_LDR_WSTR);
}