MDEV-39513 connect table_type=INI memory leak#5056
Draft
grooverdan wants to merge 1 commit intoMariaDB:11.4from
Draft
MDEV-39513 connect table_type=INI memory leak#5056grooverdan wants to merge 1 commit intoMariaDB:11.4from
grooverdan wants to merge 1 commit intoMariaDB:11.4from
Conversation
There was a problem hiding this comment.
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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