[CONCPP-15] Memory leaks found with ASAN Created: 2020-06-29  Updated: 2020-07-26  Resolved: 2020-07-26

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: None
Fix Version/s: 0.9.3

Type: Bug Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A few memory leaks were found with ASAN using the test suite:

1. Memory leak of mysql_store_result from SelectResultSetCapi.cpp:132
2. Leak of getMetaData() in many tests
3. Leak from SelectResultSet.cpp:79 (may be a leak in the test)

Also several other potential leaks I didn't dig into yet.



 Comments   
Comment by Lawrin Novitsky [ 2020-07-26 ]

1) The memory allocated there later packed into smart pointer with deleter set to mysql_free_result. Can't see how it can be leaked unless something throws in between(at first look I can't actually see what could throw there, but this case should probably be cared about)
2) These are in tests. Put everything in smart ptrs
3) From what I traced - there is no way for it to get past smart ptr. So, maybe testcases. But in testcases everything is seemingly already in smart pointers. This item is most suspicious.
But closing so far, nevertheless. Commit 94abce1

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