Bug #89797 Memory Leak
Submitted: 26 Feb 2018 9:33 Modified: 28 Jan 2021 12:29
Reporter: gang Fan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: memoryleak

[26 Feb 2018 9:33] gang Fan
Description:
There is a potential memory leak defect in mysql-server-mysql-5.5.51/cmd-line-utils/libedit/np/vis.c:383. 

The memory allocated on line 373 is assigned to variable nextra. It is not freed when this function returns to its caller on line 383. 

It is freed on line 386, which implies the developer award the necessity of freeing this memory. The leak on line 373 might be a mistake. 

How to repeat:
Static analysis, no need for a repeat. 

Suggested fix:
Free nxtra before line 383.
[26 Feb 2018 9:34] gang Fan
The sourcebrella pinpoint screenshot for a memory leak defect.

Attachment: Screenshot from 2018-02-26 17:34:10.png (image/png, text), 155.02 KiB.

[8 Mar 2018 14:31] MySQL Verification Team
Hi,

Yes, you are right about the leak. However, the function that you are mentioning and its calling functions are not actually used in the entire library.
[9 Apr 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Apr 2018 9:21] gang Fan
Sure, so what to do next? Keep it open or mark it as not important? 

Thanks
Gang
[28 Jan 2021 12:29] Erlend Dahl
The problematic code is no longer present in 5.7.30/8.0.20
[28 Jan 2021 13:03] MySQL Verification Team
Thank you, Erlend .....