#476 Memory leak: outName

Not a Bug
closed-rejected
Karl Waclawek
None
5
2012-03-05
2009-03-10
Bill Egert
No

Using cppcheck 1.30 against expat 2.0.1 yeilds:

cppcheck -j2 -a -s -q .
[./xmlwf/xmlwf.c:857]: (all) Memory leak: outName

.
.
.
if (outputDir) {
if (outputType == 'm')
metaEndDocument(parser);
fclose(fp);
if (!result)
tremove(outName);
free(outName);
}
XML_ParserFree(parser);
}
return 0;
}

shouldn't outName be freed regardless of outputDir's value?

Discussion

  • Karl Waclawek
    Karl Waclawek
    2012-03-05

    I looked at the code, and outName is only allocated when outputDir != null.

     
  • Karl Waclawek
    Karl Waclawek
    2012-03-05

    • milestone: --> Not a Bug
    • assigned_to: nobody --> kwaclaw
    • status: open --> closed-rejected