From 6eb4283ec052ddd462315fefe1d469cc510bfbd9 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Thu, 28 Sep 2006 17:08:01 +0000 Subject: [PATCH] [Backport rev.39030 by nascheme] Add missing INCREF. --- Misc/NEWS | 2 ++ Modules/gcmodule.c | 1 + 2 files changed, 3 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index 2d5e60cfc972..036cf005a8a9 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -54,6 +54,8 @@ Core and builtins Extension Modules ----------------- +- gcmodule: add a missing incref. + - threadmodule: add a missing incref. - Bug #1551427: fix a wrong NULL pointer check in the win32 version diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index e30e22f068df..e8971b0d2b64 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1169,6 +1169,7 @@ initgc(void) if (garbage == NULL) return; } + Py_INCREF(garbage); if (PyModule_AddObject(m, "garbage", garbage) < 0) return; #define ADD_INT(NAME) if (PyModule_AddIntConstant(m, #NAME, NAME) < 0) return -- 2.47.3