[MDEV-11957] Memory leak in mysql command line client Created: 2017-01-31  Updated: 2017-02-13

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.2.2
Fix Version/s: 10.2

Type: Bug Priority: Trivial
Reporter: Georg Richter Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File mysql.cc.patch    

 Description   

mysql command client (and maybe other client utilities) leak:

in main() (line 1148) stack memory for MYSQL mysql is initialized via mysql_init(&mysql).
In case no connection was established stack memory will be initialized again in function sql_real_connect.

Even if no connection was established, there might be several memory allocations, e.g. for options/options->extensions which will be initialized again without being freed before.

How to repeat:
valgrind -v --leak-check-yes ./mysql -uroot -e"SELECT 1;"



 Comments   
Comment by Marko Mäkelä [ 2017-02-13 ]

There is another memory leak in the mysql-test-run client for this input:

--perl
die
EOF

Generated at Thu Feb 08 07:53:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.