[Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.181,2.182

Mark Hammond mhammond@users.sourceforge.net
Tue, 30 Jan 2001 21:38:49 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv23045

Modified Files:
	posixmodule.c 
Log Message:
Fix Bug #125891 - os.popen2,3 and 4 leaked file objects on Windows.

Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.181
retrieving revision 2.182
diff -C2 -r2.181 -r2.182
*** posixmodule.c	2001/01/16 04:27:47	2.181
--- posixmodule.c	2001/01/31 05:38:47	2.182
***************
*** 2519,2522 ****
--- 2519,2524 ----
  
  		 f = Py_BuildValue("OO",p1,p2);
+ 		 Py_XDECREF(p1);
+ 		 Py_XDECREF(p2);
  		 file_count = 2;
  		 break;
***************
*** 2549,2552 ****
--- 2551,2557 ----
  		 PyFile_SetBufSize(p3, 0);
  		 f = Py_BuildValue("OOO",p1,p2,p3);
+ 		 Py_XDECREF(p1);
+ 		 Py_XDECREF(p2);
+ 		 Py_XDECREF(p3);
  		 file_count = 3;
  		 break;