[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.50,2.51
Fredrik Lundh
effbot@users.sourceforge.net
Mon, 15 Jan 2001 23:05:31 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv17085/Modules
Modified Files:
_sre.c
Log Message:
fixed a memory leak in pattern cleanup (patch #103248 by cgw)
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.50
retrieving revision 2.51
diff -C2 -r2.50 -r2.51
*** _sre.c 2001/01/15 12:46:09 2.50
--- _sre.c 2001/01/16 07:05:29 2.51
***************
*** 25,29 ****
* 2000-12-21 fl fixed memory leak in groupdict
* 2001-01-02 fl properly reset pointer after failed assertion in MIN_UNTIL
! * 2001-01-15 fl don't use recursion for unbounded MIN_UTIL
*
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
--- 25,30 ----
* 2000-12-21 fl fixed memory leak in groupdict
* 2001-01-02 fl properly reset pointer after failed assertion in MIN_UNTIL
! * 2001-01-15 fl don't use recursion for unbounded MIN_UTIL; fixed
! * 2001-01-16 fl fixed memory leak in pattern destructor
*
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
***************
*** 1235,1240 ****
Py_DECREF(code);
! if (PyErr_Occurred())
return NULL;
Py_INCREF(pattern);
--- 1236,1243 ----
Py_DECREF(code);
! if (PyErr_Occurred()) {
! PyObject_DEL(self);
return NULL;
+ }
Py_INCREF(pattern);
***************
*** 1533,1536 ****
--- 1536,1540 ----
Py_XDECREF(self->pattern);
Py_XDECREF(self->groupindex);
+ Py_XDECREF(self->indexgroup);
PyObject_DEL(self);
}