diff options
author | Barry Warsaw <barry@python.org> | 1999-01-27 18:04:05 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1999-01-27 18:04:05 +0000 |
commit | 105906ff6ed975f46599aac1f48c20efc508dbd8 (patch) | |
tree | bf1e100b730baf3561e9931d46d2b7d697af0958 /Modules/errnomodule.c | |
parent | 3879333b9eef62541a68d8c7fd3e95e544a1ebda (diff) | |
download | cpython-git-105906ff6ed975f46599aac1f48c20efc508dbd8.tar.gz |
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.
Diffstat (limited to 'Modules/errnomodule.c')
-rw-r--r-- | Modules/errnomodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c index f18a6555ba..ee0aaf1d92 100644 --- a/Modules/errnomodule.c +++ b/Modules/errnomodule.c @@ -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); } |