Commits

Martin von Löwis  committed 134d12c

Merged revisions 73016 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
r73016 | martin.v.loewis | 2009-05-29 17:58:08 +0200 (Fr, 29 Mai 2009) | 2 lines

Issue #4873: Fix resource leaks in error cases of pwd and grp.
........

  • Participants
  • Parent commits 28d6419

Comments (0)

Files changed (3)

 Extension Modules
 -----------------
 
+- Issue #4873: Fix resource leaks in error cases of pwd and grp.
+
 - Issue #6093: Fix off-by-one error in locale.strxfrm.
 
 - The _functools and _locale modules are now built into the libpython shared

File Modules/grpmodule.c

 
     if (PyErr_Occurred()) {
         Py_DECREF(v);
-        Py_DECREF(w);
         return NULL;
     }
 
         if (v == NULL || PyList_Append(d, v) != 0) {
             Py_XDECREF(v);
             Py_DECREF(d);
+            endgrent();
             return NULL;
         }
         Py_DECREF(v);

File Modules/pwdmodule.c

 		if (v == NULL || PyList_Append(d, v) != 0) {
 			Py_XDECREF(v);
 			Py_DECREF(d);
+			endpwent();
 			return NULL;
 		}
 		Py_DECREF(v);