Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-38823: Fix refleak in marshal init error path (GH-17260)
(cherry picked from commit 33b671e)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
  • Loading branch information
brandtbucher authored and miss-islington committed Nov 20, 2019
commit 7187ee0312ea9bbedd31cb1d98f86f5b024322ce
5 changes: 4 additions & 1 deletion Python/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,9 @@ PyMarshal_Init(void)
PyObject *mod = PyModule_Create(&marshalmodule);
if (mod == NULL)
return NULL;
PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
if (PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION) < 0) {
Py_DECREF(mod);
return NULL;
}
return mod;
}