Skip to content

Commit 91c7c6c

Browse files
'module' can also be uninitialized
1 parent f07fce8 commit 91c7c6c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Python/_warnings.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,12 +1312,13 @@ PyErr_WarnExplicit(PyObject *category, const char *text,
13121312
goto exit;
13131313
}
13141314

1315-
return PyErr_WarnExplicitObject(category, message, filename, lineno,
1316-
module, registry);
1315+
int ret = PyErr_WarnExplicitObject(category, message, filename, lineno,
1316+
module, registry);
1317+
Py_XDECREF(module);
1318+
return ret;
13171319

13181320
exit:
13191321
Py_XDECREF(message);
1320-
Py_XDECREF(module);
13211322
Py_XDECREF(filename);
13221323
return -1;
13231324
}

0 commit comments

Comments
 (0)