Skip to content

BUG: Potential memory leak in function gentype_reduce (a static analyzer report) #21495

@Snape3058

Description

@Snape3058

Reproducing code example:

Static analysis results, no POC.
This static analysis report has been manually verified as a real bug and still exists in the latest version.

Error message:

The path provided by the static analyzer is as follows.

  1. A new reference is returned from PyTuple_New and pointed to by ret.

    ret = PyTuple_New(2);

  2. Assume ret is not NULL.

  3. Call function PyImport_ImportModule, assign return value to mod.

    mod = PyImport_ImportModule("numpy.core._multiarray_umath");

  4. Assume mod is NULL,

  5. Function returns without decreasing the refcnt of ret.

Similarly, other non-decreased returns.




NumPy/Python version information:

Static analysis carried out on commit 04ab04d.

Internal bug report ID: NumPy-3f42e1 (1756), NumPy-be991e (1777)

Metadata

Metadata

Assignees

No one assigned

    Labels

    00 - BugsprintableIssue fits the time-frame and setting of a sprint

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions