8000 [3.7] bpo-38823: Fix refleak in marshal init error path (GH-17260) by miss-islington · Pull Request #17281 · 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) #17281

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

Merged
merged 1 commit into from
Nov 20, 2019
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 74f045182a3e41fe2b9c521b1d08477016d08bad
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