Summary: | A Potential Memory Leak Bug | ||
---|---|---|---|
Product: | binutils | Reporter: | yuxuan He <1157401338> |
Component: | binutils | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.34 | ||
Target Milestone: | 2.39 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | diagram of memory leak bug |
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. |
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!