Skip to content

plugins/python: Fix a memory leak coming from PyBytes_FromString#2697

Open
mitya57 wants to merge 1 commit intounbit:masterfrom
mitya57:fix-leak
Open

plugins/python: Fix a memory leak coming from PyBytes_FromString#2697
mitya57 wants to merge 1 commit intounbit:masterfrom
mitya57:fix-leak

Conversation

@mitya57
Copy link
Copy Markdown

@mitya57 mitya57 commented Dec 27, 2024

PyBytes_FromString returns a new reference, which must be freed.

To fix this, use a static function instead of a macro, and clean up inside it. Also, move the function from the header to the only place where it’s used, to fix GCC warnings about undefined function.

PyBytes_FromString returns a new reference, which must be freed.

To fix this, use a static function instead of a macro, and clean up
inside it. Also, move the function from the header to the only place
where it's used, to fix GCC warnings about undefined function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant