FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix possible leak of return of PySequence_GetItem. · quantfns/matplotlib@f0c5969 · GitHub

Repository navigation

Commit f0c5969

Browse files
committed
Fix possible leak of return of PySequence_GetItem.
1 parent a6d57b5 commit f0c5969

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/_path_wrapper.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *
727727
return NULL;
728728
}
729729
codes[i] = PyBytes_AsString(item);
730+
Py_DECREF(item);
730731
if (codes[i] == NULL) {
731732
return NULL;
732733
}

‎src/py_adaptors.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ class PathGenerator
240240
throw py::exception();
241241
}
242242
if (!convert_path(item, &path)) {
243+
Py_DECREF(item);
243244
throw py::exception();
244245
}
245246
Py_DECREF(item);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL