mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
fix refleak
This commit is contained in:
parent
f6219a588d
commit
294a9fcba6
1 changed files with 6 additions and 4 deletions
|
@ -3462,7 +3462,7 @@ imp_cache_from_source(PyObject *self, PyObject *args, PyObject *kws)
|
||||||
char buf[MAXPATHLEN+1];
|
char buf[MAXPATHLEN+1];
|
||||||
PyObject *pathbytes;
|
PyObject *pathbytes;
|
||||||
char *cpathname;
|
char *cpathname;
|
||||||
PyObject *debug_override = Py_None;
|
PyObject *debug_override = NULL;
|
||||||
int debug = !Py_OptimizeFlag;
|
int debug = !Py_OptimizeFlag;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(
|
if (!PyArg_ParseTupleAndKeywords(
|
||||||
|
@ -3470,9 +3470,11 @@ imp_cache_from_source(PyObject *self, PyObject *args, PyObject *kws)
|
||||||
PyUnicode_FSConverter, &pathbytes, &debug_override))
|
PyUnicode_FSConverter, &pathbytes, &debug_override))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (debug_override != Py_None)
|
if (debug_override != NULL &&
|
||||||
if ((debug = PyObject_IsTrue(debug_override)) < 0)
|
(debug = PyObject_IsTrue(debug_override)) < 0) {
|
||||||
return NULL;
|
Py_DECREF(pathbytes);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cpathname = make_compiled_pathname(
|
cpathname = make_compiled_pathname(
|
||||||
PyBytes_AS_STRING(pathbytes),
|
PyBytes_AS_STRING(pathbytes),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue