mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
initerrno(): Nailed a not-so-tiny memory leak. The de dictionary is
put into the module dict, but is never DECREF'd in this function, so it and all its contents leak.
This commit is contained in:
parent
3879333b9e
commit
105906ff6e
1 changed files with 2 additions and 1 deletions
|
@ -101,7 +101,7 @@ initerrno()
|
|||
m = Py_InitModule3("errno", errno_methods, errno__doc__);
|
||||
d = PyModule_GetDict(m);
|
||||
de = PyDict_New();
|
||||
if (de == NULL || PyDict_SetItemString(d,"errorcode",de))
|
||||
if (de == NULL || PyDict_SetItemString(d, "errorcode", de))
|
||||
Py_FatalError("can't initialize errno module");
|
||||
|
||||
/* Macro so I don't have to edit each and every line below... */
|
||||
|
@ -824,4 +824,5 @@ initerrno()
|
|||
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
|
||||
#endif
|
||||
|
||||
Py_DECREF(de);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue