Skip to content

Commit b96c6b0

Browse files
pablogsalmiss-islington
authored andcommitted
bpo-38962: Fix reference leak in new_interpreter() (GH-17453)
https://bugs.python.org/issue38962 Automerge-Triggered-By: @pablogsal
1 parent 808769f commit b96c6b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/pylifecycle.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,11 @@ pycore_init_builtins(PyThreadState *tstate)
648648
if (interp->builtins_copy == NULL) {
649649
goto error;
650650
}
651+
Py_DECREF(bimod);
651652
return _PyStatus_OK();
652653

653654
error:
655+
Py_XDECREF(bimod);
654656
return _PyStatus_ERR("can't initialize builtins module");
655657
}
656658

0 commit comments

Comments
 (0)