Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-4305

mem/resource leak fixes for trunk

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • None
    • Operating System: ReactOS
      Platform: x86 Hardware

    Description

      Hi, I've been running reactos through a static analysis tool called Cppcheck and have discovered some memory and resource leaks throughout the code

      Please find the attached patch on this report, review changes (in brackets) if necessary

      The changes:

      base/applications/downloader/xml.c:

      • Missing fclose() on pointer after failure

      base/services/dhcp/memory.c:

      • Perform free() on pointer if not NULL, only if the other ||'s make it enter the code block

      boot/freeldr/tools/deptool.c:

      • Perform free()'s on pointers if not NULL, only if the other ||'s make it enter the code block
      • free() pointers upon error conditions
      • free() pointers at end of function

      tools/buildno/buildno.cpp:

      • Add condition when a memory allocation fails, fclose() and free() needed pointers and return;
      • Add missing free() on error condition
      • free() pointer at end of code block

      tools/cdmake/cdmake.c:

      • fclose() pointer on condition
      • Remove double free (PLEASE CHECK)

      tools/mkconfig.c:

      • free() buffer on error condition before exiting
      • free() buffer at end of function

      tools/rbuild/rbuild.h:

      • Derived class Include requires virtual destructor from classes ToolsetDirective, CompilerDirective

      tools/rsym/log2lines.c:

      • Add missing fclose()

      tools/stubgen.c:

      • Release resources before returning
      • Use pclose() instead of fclose() on popen()'d pointer

      Please make sure the changes are ok before committing, or fix if necessary

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              _russell_ _Russell_
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: