From b96c6b0723b889d3a0c1740bce7f579f33d246f2 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Wed, 4 Dec 2019 11:19:59 +0000 Subject: [PATCH] bpo-38962: Fix reference leak in new_interpreter() (GH-17453) https://bugs.python.org/issue38962 Automerge-Triggered-By: @pablogsal --- Python/pylifecycle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index cce4783bc12..9218978cc6f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -648,9 +648,11 @@ pycore_init_builtins(PyThreadState *tstate) if (interp->builtins_copy == NULL) { goto error; } + Py_DECREF(bimod); return _PyStatus_OK(); error: + Py_XDECREF(bimod); return _PyStatus_ERR("can't initialize builtins module"); }