Skip to content

Conversation

@henyu6
Copy link

@henyu6 henyu6 commented Jan 30, 2025

When we call PyInt_FromLong, the reference count is increased and PyList_Append increasing the reference count again because when using PyList_Append, the reference count is incremented and not taken.

The change made is to set the result of PyInt_FromLong, append it to the list, then decrement the reference count.

@henyu6 henyu6 force-pushed the fix-leak-spooler-pids branch from ea40863 to 30470ba Compare January 30, 2025 01:13
struct uwsgi_spooler *uspool = uwsgi.spoolers;
while (uspool) {
PyList_Append(ret, PyInt_FromLong(uspool->pid));
PyObject *spool_pid = PyInt_FromLong(uspool->pid)
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a semicolon ";" missing at the end.

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.

3 participants