diff options
| author | Mark Dickinson <dickinsm@gmail.com> | 2010-07-29 21:44:47 (GMT) |
|---|---|---|
| committer | Mark Dickinson <dickinsm@gmail.com> | 2010-07-29 21:44:47 (GMT) |
| commit | 96527c3b59a957de9b255f95f0ab73b04a124d8c (patch) | |
| tree | 46cb958c9ae4bb8ff8afeaed14be5bc77c45fbd4 | |
| parent | 0969c67bf5fd53e54e230cee99518bcd0988b657 (diff) | |
| download | cpython-96527c3b59a957de9b255f95f0ab73b04a124d8c.zip cpython-96527c3b59a957de9b255f95f0ab73b04a124d8c.tar.gz cpython-96527c3b59a957de9b255f95f0ab73b04a124d8c.tar.bz2 | |
Merged revisions 83239 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83239 | mark.dickinson | 2010-07-29 22:41:59 +0100 (Thu, 29 Jul 2010) | 2 lines
Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
........
| -rw-r--r-- | Misc/NEWS | 2 | ||||
| -rw-r--r-- | Modules/_struct.c | 3 |
2 files changed, 5 insertions, 0 deletions
@@ -64,6 +64,8 @@ Library Extension Modules ----------------- +- Issue #9422: Fix memory leak when re-initializing a struct.Struct object. + - Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly compared to other unix systems. In particular, os.getgroups() does not reflect any changes made using os.setgroups() but basicly always diff --git a/Modules/_struct.c b/Modules/_struct.c index f22c31c..71e71dd 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1289,6 +1289,9 @@ prepare_s(PyStructObject *self) PyErr_NoMemory(); return -1; } + /* Free any s_codes value left over from a previous initialization. */ + if (self->s_codes != NULL) + PyMem_FREE(self->s_codes); self->s_codes = codes; s = fmt; |
