-
Notifications
You must be signed in to change notification settings - Fork 21.2k
Description
Hi, I have found a potential memory leak bug in src/network.c and would like to report it to the maintainers. Can you please help me to check it? Thank you for your effort and patience!
Below is the execution sequence of the program that may produce the bug.
First, in the file src/utils.c, the function xrealloc_location allocates memory on line 38.
Second, in file src/network.c, the function make_network calls the macro on line 250, which actually calls xrealloc_location to allocate memory for net.delta_rolling_max, and later returns net on line 266.
Third, in file src/network.c, function combine_train_valid_networks calls make_network on line 1491 to allocate memory for net_combined.
Finally, on line 1493, net_combined is redefined as net_train, which causes the previously allocated memory to be inaccessible, leading to a memory leak vulnerability.
Thank you very much for reading and I look forward to hearing from you!
