Skip to content

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

@Snape3058

Description

@Snape3058

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions