[Python-checkins] r71025 - in python/branches/release30-maint: Python/symtable.c

benjamin.peterson python-checkins at python.org
Thu Apr 2 04:52:10 CEST 2009


Author: benjamin.peterson
Date: Thu Apr 2 04:52:09 2009
New Revision: 71025
Log:
Merged revisions 71018,71020-71021 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
 r71018 | benjamin.peterson | 2009年04月01日 20:50:37 -0500 (2009年4月01日) | 1 line
 
 fix ref leaks
........
 r71020 | benjamin.peterson | 2009年04月01日 21:27:20 -0500 (2009年4月01日) | 1 line
 
 rewrite error handling to make sense
........
 r71021 | benjamin.peterson | 2009年04月01日 21:27:56 -0500 (2009年4月01日) | 1 line
 
 remove unused variable
........
Modified:
 python/branches/release30-maint/ (props changed)
 python/branches/release30-maint/Python/symtable.c
Modified: python/branches/release30-maint/Python/symtable.c
==============================================================================
--- python/branches/release30-maint/Python/symtable.c	(original)
+++ python/branches/release30-maint/Python/symtable.c	Thu Apr 2 04:52:09 2009
@@ -765,6 +765,7 @@
 
 	if (PyNumber_InPlaceOr(newfree, allfree) < 0)
 		goto error;
+	Py_DECREF(newfree);
 
 	/* Check if any local variables must be converted to cell variables */
 	if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree,
@@ -801,7 +802,6 @@
 		 PyObject *global, PyObject* child_free)
 {
 	PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL;
-	int success = 0;
 
 	/* Copy the bound and global dictionaries.
 
@@ -822,13 +822,18 @@
 
 	if (!analyze_block(entry, temp_bound, temp_free, temp_global))
 		goto error;
-	success = PyNumber_InPlaceOr(child_free, temp_free) >= 0;
-	success = 1;
+	if (PyNumber_InPlaceOr(child_free, temp_free) < 0)
+		goto error;
+	Py_DECREF(child_free);
+	Py_DECREF(temp_bound);
+	Py_DECREF(temp_free);
+	Py_DECREF(temp_global);
+	return 1;
 error:
 	Py_XDECREF(temp_bound);
 	Py_XDECREF(temp_free);
 	Py_XDECREF(temp_global);
-	return success;
+	return 0;
 }
 
 static int


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /