[Python-Dev] Re: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.318, 2.319

Thomas Heller theller at python.net
Tue Jun 8 06:36:07 EDT 2004


nnorwitz at users.sourceforge.net writes:

> Update of /cvsroot/python/python/dist/src/Modules
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16270/Modules
>
> Modified Files:
> 	posixmodule.c 
> Log Message:
> Plug a few memory leaks in utime().  path is allocated from within 
> PyArg_ParseTuple() since the format is "et"  This change should
> be reviewed carefully.

I believe 'path' must be set to NULL at the start of the posix_utime
function - I had a crash in a debug build on windows when running
lib\test\test_unicode_file.py.

Thomas

Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.319
diff -c -r2.319 posixmodule.c
*** posixmodule.c	6 Jun 2004 20:40:27 -0000	2.319
--- posixmodule.c	8 Jun 2004 10:35:03 -0000
***************
*** 1994,2000 ****
  static PyObject *
  posix_utime(PyObject *self, PyObject *args)
  {
! 	char *path;
  	long atime, mtime, ausec, musec;
  	int res;
  	PyObject* arg;
--- 1994,2000 ----
  static PyObject *
  posix_utime(PyObject *self, PyObject *args)
  {
! 	char *path = NULL;
  	long atime, mtime, ausec, musec;
  	int res;
  	PyObject* arg;




More information about the Python-Dev mailing list