From: Barry Warsaw <barry@python.org>
Date: Fri, 29 Jan 1999 21:30:22 +0000 (+0000)
Subject: initmain(): Nailed a memory leak.  bimod must be DECREF'd!
X-Git-Tag: v1.5.2b2~204
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d05b1a0ae8ad4acf733f03b45cf9c51bf3ff47c;p=python

initmain(): Nailed a memory leak.  bimod must be DECREF'd!
---

diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 6948829418..2d065cf22d 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -411,6 +411,7 @@ initmain()
 		if (bimod == NULL ||
 		    PyDict_SetItemString(d, "__builtins__", bimod) != 0)
 			Py_FatalError("can't add __builtins__ to __main__");
+		Py_DECREF(bimod);
 	}
 }