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 | ce4a52cd0c39a1d04dfc2e90ffc098b03a194a1c (patch) | |
tree | 2c71ba5474291c60bbeb8dad527b24cc9260d82c | |
parent | 3c2d0ca7216740cd8e53f8bd8c4759638a95b5eb (diff) | |
download | cpython-ce4a52cd0c39a1d04dfc2e90ffc098b03a194a1c.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.
-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); } |