Created attachment 14150 [details]
diagram of memory leak bug
Hi, I found a potential memory leak bug in the project source code of binutils, I have shown the execution sequence of the program that may generate the bug on a diagram which is added to the attachment.
The text in red illustrates the steps that generate the bug
The red arrows represent call relationships
The green text illustrates the files and functions whose code snippets are located below the green text.
In short, the key to the bug is the third step in the diagram. In the third step, when select the true branch, program will directly "return FALSE", instead of doing the free operation like the red box in the figure.
I look forward to your reply and thank you very much for your patience!
The master branch has been updated by Alan Modra <firstname.lastname@example.org>:
Author: Alan Modra <email@example.com>
Date: Mon Jun 20 10:39:13 2022 +0930
PR29261, memory leak in parse_stab_struct_fields
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.