[ros-bugs] [Bug 2694] New: Possible memory leak.

ReactOS.Bugzilla at www.reactos.org ReactOS.Bugzilla at www.reactos.org
Wed Sep 26 17:53:55 CEST 2007


http://www.reactos.org/bugzilla/show_bug.cgi?id=2694

           Summary: Possible memory leak.
           Product: ReactOS
           Version: 0.3.3
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Kernel
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: yaron.aharonson at gmail.com
         QAContact: ros-bugs at reactos.org


the following segment was taken from hivewrt.c (43) - note the warning in the
code:

   Buffer = RegistryHive->Allocate(BufferSize, TRUE);
   if (Buffer == NULL)
   {
      return FALSE;
   }

   /* Update first update counter and checksum */
   RegistryHive->HiveHeader->Type = HV_TYPE_LOG;
   RegistryHive->HiveHeader->Sequence1++;
   RegistryHive->HiveHeader->Checksum =
      HvpHiveHeaderChecksum(RegistryHive->HiveHeader);

   /* Copy hive header */
   RtlCopyMemory(Buffer, RegistryHive->HiveHeader, HV_LOG_HEADER_SIZE);
   Ptr = Buffer + HV_LOG_HEADER_SIZE;
   RtlCopyMemory(Ptr, "DIRT", 4);
   Ptr += 4;
   RtlCopyMemory(Ptr, RegistryHive->DirtyVector.Buffer, BitmapSize);

   /* Write hive block and block bitmap */
   Success = RegistryHive->FileWrite(RegistryHive, HV_TYPE_LOG,
                                     0, Buffer, BufferSize);
   if (!Success)
   {
      !!!!!!!!WARNING memory leak here! Buffer was not released! we should free
      !!!!!!!!Buffer before testing for success - this way, Buffer is released
      !!!!!!!!no matter what
      return FALSE;
   }

   RegistryHive->Free(Buffer);


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the Ros-bugs mailing list