]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- posixmodule.c - Add missing prototypes in for SunOS 4.1.4, plug memory leak
authorMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 08:10:03 +0000 (08:10 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 08:10:03 +0000 (08:10 +0000)
- #125891 - posixmodule.c - os.popen2,3 and 4 leaked file objects on Windows.

- #128053 - posixmodule.c - #ifdef for including "tmpfile" in the
            posix_methods[] array was wrong -- should be HAVE_TMPFILE

Misc/NEWS
Modules/posixmodule.c

index 5968689ddd26e71cc4a8addc43047f12752d0b68..575bee5578594121ac72551bbf011e79bb5f2c27 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -76,6 +76,13 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
 
 - #232787 -- Modules/timemodule.c, Python/errors.c, Objects/intobject.c
 
+- posixmodule.c - Add missing prototypes in for SunOS 4.1.4, plug memory leak
+
+- #125891 - posixmodule.c - os.popen2,3 and 4 leaked file objects on Windows.
+
+- #128053 - posixmodule.c - #ifdef for including "tmpfile" in the 
+            posix_methods[] array was wrong -- should be HAVE_TMPFILE
+
 What's New in Python 2.0?
 =========================
 
index 8544f6a9415153e85d4fd39e9ddfcf23353c901f..3359741b809c09760196ccc160502fc4dc98b07d 100644 (file)
@@ -113,6 +113,9 @@ corresponding Unix manual entries for more information on calls.";
 extern int rename(const char *, const char *);
 extern int pclose(FILE *);
 extern int fclose(FILE *);
+extern int fsync(int);
+extern int lstat(const char *, struct stat *);
+extern int symlink(const char *, const char *);
 #endif
 
 #ifdef NeXT
@@ -2509,6 +2512,8 @@ _PyPopen(char *cmdstring, int mode, int n)
                         CloseHandle(hChildStderrRdDup);
 
                 f = Py_BuildValue("OO",p1,p2);
+                Py_XDECREF(p1);
+                Py_XDECREF(p2);
                 file_count = 2;
                 break;
         }
@@ -2539,6 +2544,9 @@ _PyPopen(char *cmdstring, int mode, int n)
                 PyFile_SetBufSize(p2, 0);
                 PyFile_SetBufSize(p3, 0);
                 f = Py_BuildValue("OOO",p1,p2,p3);
+                Py_XDECREF(p1);
+                Py_XDECREF(p2);
+                Py_XDECREF(p3);
                 file_count = 3;
                 break;
         }
@@ -5348,7 +5356,7 @@ static PyMethodDef posix_methods[] = {
 #ifdef HAVE_STATVFS
        {"statvfs",     posix_statvfs, METH_VARARGS, posix_statvfs__doc__},
 #endif
-#ifdef HAVE_TMPNAM
+#ifdef HAVE_TMPFILE
        {"tmpfile",     posix_tmpfile, METH_VARARGS, posix_tmpfile__doc__},
 #endif
 #ifdef HAVE_TEMPNAM
@@ -5569,6 +5577,7 @@ INITFUNC(void)
        PyDict_SetItemString(d, "error", PyExc_OSError);
 
 #ifdef HAVE_PUTENV
-       posix_putenv_garbage = PyDict_New();
+       if (posix_putenv_garbage == NULL)
+               posix_putenv_garbage = PyDict_New();
 #endif
 }