Created attachment 14151 [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 the true branch is selected, the program will directly "return FALSE" instead of doing a free operation on 's',and the function call in the condition statement does not do a free operation on 's', which leads to a memory leak. I look forward to your reply and thank you very much for your patience!
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0d02e70b197c786f26175b9a73f94e01d14abdab commit 0d02e70b197c786f26175b9a73f94e01d14abdab Author: Alan Modra <amodra@gmail.com> Date: Mon Jun 20 10:39:31 2022 +0930 PR29262, memory leak in pr_function_type PR 29262 * prdbg.c (pr_function_type): Free "s" on failure path.
Fixed.
(In reply to Alan Modra from comment #2) > Fixed. Thank you.