cti header formats memory leak
Both CTFinitialize
and GLOBinitializeGlobal
set
global.cti_primary_header_format = STRcpy (CTF_DEFAULT_FIRST_LINE_HEADER);
and global.cti_continuation_header_format = STRcpy (CTF_DEFAULT_MULTI_LINE_HEADER);
static node *
SetupCompiler (int argc, char *argv[], tool_t tool, char *toolname)
{
DBUG_ENTER ();
...
CTFinitialize ();
...
GLOBinitializeGlobal (argc, argv, tool, toolname);
...
This creates a memory leak. I think we just move CTFinitialize
to after the global initalisation.
Also
ARGS_OPTION ("cti-primary-header-format", global.cti_primary_header_format = STRcpy (ARG));
in options.c
looks shady. Should we not optionally free first?