We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a0fc07 commit cf28b95Copy full SHA for cf28b95
Misc/NEWS
@@ -1492,6 +1492,8 @@ Library
1492
Extension Modules
1493
-----------------
1494
1495
+- Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
1496
+
1497
- Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
1498
compared to other unix systems. In particular, os.getgroups() does
1499
not reflect any changes made using os.setgroups() but basicly always
Modules/_struct.c
@@ -1247,6 +1247,9 @@ prepare_s(PyStructObject *self)
1247
PyErr_NoMemory();
1248
return -1;
1249
}
1250
+ /* Free any s_codes value left over from a previous initialization. */
1251
+ if (self->s_codes != NULL)
1252
+ PyMem_FREE(self->s_codes);
1253
self->s_codes = codes;
1254
1255
s = fmt;
0 commit comments