Menu

#8 Fix to memory leaks

v1.0_(example)
open
memory leak (1)
1
2020-01-08
2020-01-08
No

Hi Nikko,
I have been tracking some deallocation problems using AddressSanitizer in version 1.1.2. The simple programme I used is test_memory.c, in attachment. It just reads a network, compiles the simulator and then frees everything. In the following I summarize the problems I found. I also attach the patches to fix those problems. It would be great if you could include them in the next version, if you ever make one.

Problems:
RTDNN.c, FreeStream: missing FREE(str->Filter);

RTDNN.c, FreeNet: missing

  • FREE(net->Name);
  • FREE(net);

Simulation.c FreeNetWork: missing

  • FREE(net->Constants)
  • FREE2D(net->stream_comp_name, net->NumExt);
  • FREE2D(net->ConLink, net->NumUnits);
  • FREE(net->stream_filter) should be FREE2D(net->stream_filter, net->NumStreams);
  • FREE(net);

RTSim.c FreeRTSim: missing:

  • FREE(work->input_component_name);
  • FREE(work->output_component_name);

Best
Giampiero

4 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB