From e4bc7f69c28b7edfbc9ccdf7be6b5249b38f6cbd Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 17 Jan 2009 21:06:43 +0000 Subject: Issue #4838: When a module is deallocated, free the memory backing the optional module state data. --- Objects/moduleobject.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Objects/moduleobject.c') diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 9c705b888d..0c6032fbe8 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); } -- cgit v1.2.1