Kaydet (Commit) 2da63cc3 authored tarafından Mark Dickinson's avatar Mark Dickinson

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.
........
üst 8a550f31
...@@ -323,6 +323,8 @@ Library ...@@ -323,6 +323,8 @@ Library
Extension Modules 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 - Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
compared to other unix systems. In particular, os.getgroups() does compared to other unix systems. In particular, os.getgroups() does
not reflect any changes made using os.setgroups() but basicly always not reflect any changes made using os.setgroups() but basicly always
......
...@@ -1233,6 +1233,9 @@ prepare_s(PyStructObject *self) ...@@ -1233,6 +1233,9 @@ prepare_s(PyStructObject *self)
PyErr_NoMemory(); PyErr_NoMemory();
return -1; 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; self->s_codes = codes;
s = fmt; s = fmt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment