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

Memory leaks when function returns directly on failure without decreasing the refcnt of a new reference (static analyzer reports) #6322

Closed
Snape3058 opened this issue May 23, 2022 · 1 comment · Fixed by #6999
Labels

Comments

@Snape3058
Copy link

New reference is returned here:

m = PyModule_Create(&module_def);

Function returns without decreasing the refcnt.
return NULL;

Internal Report ID: 3fa97f


New reference is returned here:

list_names = PyList_New(num_namedstyles);

Function returns without decreasing the refcnt.
return geterror(error);

Internal Report ID: 60bc38


New reference is returned here:

list_axes = PyList_New(num_axis);

Function returns without decreasing the refcnt.
return geterror(error);

Internal Report ID: 775d14


New reference is returned here:

list_axis = PyDict_New();

Function returns without decreasing the refcnt.
return geterror(error);

Internal Report ID: 379efb


New reference is returned here:

PyObject *ret = PyList_New(0);

Function returns without decreasing the refcnt.
return NULL;

Internal Report ID: 8cc0d2


New reference is returned here:

PyObject *ret = PyList_New(0);

Function returns without decreasing the refcnt.
return NULL;

Internal Report ID: 239db5


New reference is returned here:

m = PyModule_Create(&module_def);

Function returns without decreasing the refcnt (when ?: operator takes the false branch).
return (load_tkinter_funcs() == 0) ? m : NULL;

Internal Report ID: bc9c58


New reference is returned here:

m = PyModule_Create(&module_def);

Function returns without decreasing the refcnt.
return NULL;

Internal Report ID: e4ed93

@radarhere radarhere changed the title BUG: Memory leaks when function returns directly on failure without decreasing the refcnt of a new reference (static analyzer reports) Memory leaks when function returns directly on failure without decreasing the refcnt of a new reference (static analyzer reports) Aug 6, 2022
@radarhere
Copy link
Member

PR #6999 will resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants