Mercurial > cpython-lru_cache-weakref
diff Modules/_struct.c @ 63301:89d78b667d07 2.6
Merged revisions 83241 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
................
r83241 | mark.dickinson | 2010-07-29 22:44:47 +0100 (Thu, 29 Jul 2010) | 9 lines
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.
........
................
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Thu, 29 Jul 2010 21:47:28 +0000 |
| parents | c16b3f6ac511 |
| children | 787b969d37f0 |
line wrap: on
line diff
--- a/Modules/_struct.c Wed Jul 28 01:58:41 2010 +0000 +++ b/Modules/_struct.c Thu Jul 29 21:47:28 2010 +0000 @@ -1404,6 +1404,9 @@ 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;
