From 54b32c987146123f2237f0e21b1d02b1c1ebdf6f Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 19 Nov 2019 11:16:29 -0800 Subject: [PATCH] bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236) --- Modules/fcntlmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 1e5b0f7faea..11906aa5829 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -668,8 +668,10 @@ PyInit_fcntl(void) return NULL; /* Add some symbolic constants to the module */ - if (all_ins(m) < 0) + if (all_ins(m) < 0) { + Py_DECREF(m); return NULL; + } return m; }