Commit 7a8818e7 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

Don't check pointers for NULL before RtlFreeHeap. It is redundant.

parent 968ad51d
...@@ -386,11 +386,8 @@ void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit ) ...@@ -386,11 +386,8 @@ void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit )
HANDLE sem = crit->LockSemaphore; HANDLE sem = crit->LockSemaphore;
if (!sem) NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 ); if (!sem) NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 );
crit->LockSemaphore = ConvertToGlobalHandle( sem ); crit->LockSemaphore = ConvertToGlobalHandle( sem );
if (crit->DebugInfo) RtlFreeHeap( GetProcessHeap(), 0, crit->DebugInfo );
{ crit->DebugInfo = NULL;
RtlFreeHeap( GetProcessHeap(), 0, crit->DebugInfo );
crit->DebugInfo = NULL;
}
} }
......
...@@ -107,9 +107,9 @@ NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER iBuf) ...@@ -107,9 +107,9 @@ NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER iBuf)
NTSTATUS nts = STATUS_SUCCESS; NTSTATUS nts = STATUS_SUCCESS;
FIXME("(%p): stub\n", iBuf); FIXME("(%p): stub\n", iBuf);
if (NULL != iBuf) { if (NULL != iBuf) {
if (NULL != iBuf->ModuleInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->ModuleInformation); RtlFreeHeap(GetProcessHeap(), 0, iBuf->ModuleInformation);
if (NULL != iBuf->HeapInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->HeapInformation); RtlFreeHeap(GetProcessHeap(), 0, iBuf->HeapInformation);
if (NULL != iBuf->LockInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->LockInformation); RtlFreeHeap(GetProcessHeap(), 0, iBuf->LockInformation);
RtlFreeHeap(GetProcessHeap(), 0, iBuf); RtlFreeHeap(GetProcessHeap(), 0, iBuf);
} }
return nts; return nts;
......
...@@ -345,8 +345,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG ...@@ -345,8 +345,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
} }
} }
if (info) RtlFreeHeap( GetProcessHeap(), 0, info );
RtlFreeHeap( GetProcessHeap(), 0, info );
return ret; return ret;
} }
......
...@@ -470,7 +470,7 @@ error: ...@@ -470,7 +470,7 @@ error:
SIZE_T size = 0; SIZE_T size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE ); NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
} }
if (info) RtlFreeHeap( GetProcessHeap(), 0, info ); RtlFreeHeap( GetProcessHeap(), 0, info );
if (handle) NtClose( handle ); if (handle) NtClose( handle );
close( request_pipe[1] ); close( request_pipe[1] );
return status; return status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment