[Python-checkins] bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236)

T. Wouters webhook-mailer at python.org
Tue Nov 19 14:16:59 EST 2019


https://github.com/python/cpython/commit/54b32c987146123f2237f0e21b1d02b1c1ebdf6f
commit: 54b32c987146123f2237f0e21b1d02b1c1ebdf6f
branch: master
author: Brandt Bucher <brandtbucher at gmail.com>
committer: T. Wouters <thomas at python.org>
date: 2019-11-19T11:16:29-08:00
summary:

bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236)

files:
M Modules/fcntlmodule.c

diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 1e5b0f7faea6f..11906aa582929 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;
 }



More information about the Python-checkins mailing list