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

This commit is contained in:
Michael Stefaniuc 2006-05-01 22:44:43 +02:00 committed by Alexandre Julliard
parent 968ad51d2a
commit 7a8818e717
4 changed files with 7 additions and 11 deletions

View File

@ -386,11 +386,8 @@ void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit )
HANDLE sem = crit->LockSemaphore;
if (!sem) NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 );
crit->LockSemaphore = ConvertToGlobalHandle( sem );
if (crit->DebugInfo)
{
RtlFreeHeap( GetProcessHeap(), 0, crit->DebugInfo );
crit->DebugInfo = NULL;
}
RtlFreeHeap( GetProcessHeap(), 0, crit->DebugInfo );
crit->DebugInfo = NULL;
}

View File

@ -107,9 +107,9 @@ NTSTATUS WINAPI RtlDestroyQueryDebugBuffer(IN PDEBUG_BUFFER iBuf)
NTSTATUS nts = STATUS_SUCCESS;
FIXME("(%p): stub\n", iBuf);
if (NULL != iBuf) {
if (NULL != iBuf->ModuleInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->ModuleInformation);
if (NULL != iBuf->HeapInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->HeapInformation);
if (NULL != iBuf->LockInformation) RtlFreeHeap(GetProcessHeap(), 0, iBuf->LockInformation);
RtlFreeHeap(GetProcessHeap(), 0, iBuf->ModuleInformation);
RtlFreeHeap(GetProcessHeap(), 0, iBuf->HeapInformation);
RtlFreeHeap(GetProcessHeap(), 0, iBuf->LockInformation);
RtlFreeHeap(GetProcessHeap(), 0, iBuf);
}
return nts;

View File

@ -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;
}

View File

@ -470,7 +470,7 @@ error:
SIZE_T size = 0;
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
}
if (info) RtlFreeHeap( GetProcessHeap(), 0, info );
RtlFreeHeap( GetProcessHeap(), 0, info );
if (handle) NtClose( handle );
close( request_pipe[1] );
return status;