Skip to content

MDEV-39513 connect table_type=INI memory leak#5056

Draft
grooverdan wants to merge 1 commit intoMariaDB:11.4from
grooverdan:MDEV-39513
Draft

MDEV-39513 connect table_type=INI memory leak#5056
grooverdan wants to merge 1 commit intoMariaDB:11.4from
grooverdan:MDEV-39513

Conversation

@grooverdan
Copy link
Copy Markdown
Member

The MRUProfile structure, of which CurProfile=MRUProfile[0] can contain a filename that is allocated. It is possible for the CurProfile to be null, while others are allocated, including those with a MRUProfile.filename already malloc.

As such the full PROFILE_ReleaseFile needs to be called on all non-null MRUProfile entries to prevent a memory leak.

Corrects MDEV-9997

@grooverdan grooverdan requested a review from sanja-byelkin May 8, 2026 07:32
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 8, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a memory leak in the CONNECT engine's INI table type (MDEV-39513) by ensuring all cached profiles are released and freed during PROFILE_End. Feedback highlights the need to nullify pointers in the MRUProfile array to prevent potential use-after-free issues and points out a portability issue in the new test case due to a hardcoded absolute path in the result file.

Comment thread storage/connect/inihandl.cpp
Comment thread storage/connect/mysql-test/connect/t/ini_alone.test
The MRUProfile structure, of which CurProfile=MRUProfile[0]
can contain a filename that is allocated. It is possible
for the CurProfile to be null, while others are allocated,
including those with a MRUProfile.filename already malloc.

As such the full PROFILE_ReleaseFile needs to be called on
all non-null MRUProfile entries to prevent a memory leak.

Corrects MDEV-9997
@grooverdan grooverdan marked this pull request as draft May 8, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

2 participants