]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38823: Clean up refleak in fcntl module initialization. (GH-17236)
authorBrandt Bucher <brandtbucher@gmail.com>
Tue, 19 Nov 2019 19:16:29 +0000 (11:16 -0800)
committerT. Wouters <thomas@python.org>
Tue, 19 Nov 2019 19:16:29 +0000 (11:16 -0800)
Modules/fcntlmodule.c

index 1e5b0f7faea6fb6f265ac1818f2fb0ee7e6a6e6f..11906aa582929612ca643d07a522856a198d4f59 100644 (file)
@@ -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;
 }