Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-415

Potential memory leaks in int AxisConfig::readConfFile () function

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 1.5 Alpha
    • None
    • Basic Architecture
    • None
    • Windows

    Description

      Assigning a new value to pcValue poiner without checking for NULL will lead to memory leaks...

      while (AXIS_SUCCESS == fileConfig.fileGet (carrLine, CONFBUFFSIZE))
      {
      int linesize = strlen (carrLine);
      /*
      Ignore lines starting with # and empty lines
      */
      if (carrLine[0] == pcComment || carrLine[0] == '\0')
      continue;

      /*Better to add following lines here

      if(pcValue)

      { delete pcValue; pcValue=NULL; }

      */

      pcValue = strpbrk (carrLine, pcSeparator);

      Attachments

        Activity

          People

            Unassigned Unassigned
            dchandradasa Marcus Dushshantha Chandradasa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: