Skip to content

Two memory leaks in function text_layout_raqm due to new reference is not decreased (static analyzer reports) #6321

@Snape3058

Description

@Snape3058
  1. A new reference is returned and assigned to seq.

    PyObject *seq = PySequence_Fast(features, "expected a sequence");

  2. seq is only passed to APIs that do not steal a reference from the argument before it goes out of scope.

    len = PySequence_Size(seq);

    PyObject *item = PySequence_Fast_GET_ITEM(seq, j);

Internal Report ID: 3d6af5


  1. A new reference is returned and assigned to bytes.

    bytes = PyUnicode_AsUTF8String(item);

  2. bytes is only passed to APIs that do not steal a reference from the argument before it goes out of scope.

    feature = PyBytes_AS_STRING(bytes);

    size = PyBytes_GET_SIZE(bytes);

Internal Report ID: 54b828

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