#1350 gnuplot.doc converters do not call fclose()

5.0
closed-invalid
nobody
None
5
2014-03-31
2014-03-10
Anonymous
No

Resource leak in file docs/windows/doc2html.c, function main, variable contents when macro CREATE_INDEX is not defined.

Also, a possibly null deference in variable index when macro CREATE_INDEX is not defined. Since it passes null to function convert().

Discussion

    • summary: Resource Leak in docs/windows/doc2html.c --> gnuplot.doc converters do not call fclose()
    • status: open --> pending-invalid
     
  • Resource leak in file docs/windows/doc2html.c, function main, variable contents when macro CREATE_INDEX is not defined.

    Since I am not quite sure what you mean by "resource leak", I am assuming that you refer to the fact that there are some fclose() statements missing at the end of main(). While this is certainly not good style, it is also not a problem since the C runtime or the operating system will close any open files on leaving main(). Moreover, I fail to see why this should depend on CREATE_INDEX being defined or not.

    In fact all of the doc2xxx converters I checked are missing calls to fclose() at the end of main().

    Also, a possibly null deference in variable index when macro CREATE_INDEX is not defined. Since it passes null to function convert().

    CREATE_INDEX is only defined when building WxWidgets help files. On Windows, the help compiler does that automatically for us and we do not define CREATE_INDEX. This is the default case. I just rechecked and could not find any problem with index being NULL.

     
    • status: pending-invalid --> closed-invalid