diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-17 21:06:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-01-17 21:06:43 (GMT) |
commit | e4bc7f69c28b7edfbc9ccdf7be6b5249b38f6cbd (patch) | |
tree | f1354063a5075a58f507615afaa2c59ae4356b01 /Objects/moduleobject.c | |
parent | 0c3f8a4800a84f1887db7fcac6b65c1f8cedf43c (diff) | |
download | cpython-e4bc7f69c28b7edfbc9ccdf7be6b5249b38f6cbd.zip cpython-e4bc7f69c28b7edfbc9ccdf7be6b5249b38f6cbd.tar.gz cpython-e4bc7f69c28b7edfbc9ccdf7be6b5249b38f6cbd.tar.bz2 |
Issue #4838: When a module is deallocated, free the memory backing the optional module state data.
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r-- | Objects/moduleobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 9c705b8..0c6032f 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -315,6 +315,8 @@ module_dealloc(PyModuleObject *m) _PyModule_Clear((PyObject *)m); Py_DECREF(m->md_dict); } + if (m->md_state != NULL) + PyMem_FREE(m->md_state); Py_TYPE(m)->tp_free((PyObject *)m); } |