Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP #1754 > support/v5.12] Fix memory leaks in Python wrapper by adding missing Py_DECREF. #1759

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

eclipse-ecal-bot
Copy link
Contributor

Cherry-pick

Cherry-picked PR #1754 to branch support/v5.12.
The cherry-pick was successful.

Please review the changes and rebase-merge if desired.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -1489,7 +1489,8 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/)
}
}

return(Py_BuildValue("iO", 0, retDict));
auto* retVal = Py_BuildValue("iO", 0, retDict); Py_DECREF(retDict);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'retVal' is not initialized [cppcoreguidelines-init-variables]

Suggested change
auto* retVal = Py_BuildValue("iO", 0, retDict); Py_DECREF(retDict);
auto* retVal = nullptr = Py_BuildValue("iO", 0, retDict); Py_DECREF(retDict);

@@ -1533,7 +1534,8 @@
}
}

return(Py_BuildValue("iO", 0, retList));
auto* retVal = Py_BuildValue("iO", 0, retList); Py_DECREF(retList);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: variable 'retVal' is not initialized [cppcoreguidelines-init-variables]

Suggested change
auto* retVal = Py_BuildValue("iO", 0, retList); Py_DECREF(retList);
auto* retVal = nullptr = Py_BuildValue("iO", 0, retList); Py_DECREF(retList);

@KerstinKeller KerstinKeller merged commit cf246e7 into support/v5.12 Oct 2, 2024
15 of 17 checks passed
@KerstinKeller KerstinKeller deleted the cherry-pick/60f7835/support/v5.12 branch October 2, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants