8000 [3.7] bpo-38823: Fix refleak in marshal init error path (GH-17260) by miss-islington · Pull Request #17272 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.7] bpo-38823: Fix refleak in marshal init error path (GH-17260) #17272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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 755cfc762ca103efaf22fc0195093866df6f4520
5 changes: 4 additions & 1 deletion Python/marshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,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;
}
0