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

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

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

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

This report is similar to https://bugs.mysql.com/bug.php?id=89797&thanks=4. 

How to repeat:
No need to repeat. 

Suggested fix:
Free nextra on before line 436.
[8 Mar 2018 14:18] MySQL Verification Team

Yes, this is a very small memory leak, but still a memory leak.

[8 Mar 2018 14:31] MySQL Verification Team

On further analysis, seems that this function is not called anywhere within that 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".
[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:02] MySQL Verification Team
Thank you, Erlend ......