Fixed memory leak in executemany

This commit is contained in:
Federico Di Gregorio 2008-05-19 10:14:17 +02:00
parent f1fab54b97
commit 6073193314
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-05-19 Federico Di Gregorio <fog@initd.org>
* psycopg/cursor_type.c: fixed memory leak in .executemany(); on
error "iter" was not dec'reffed.
2008-05-06 James Henstridge <james@jamesh.id.au> 2008-05-06 James Henstridge <james@jamesh.id.au>
* psycopg/lobject.h (lobjectObject): remove "mode" struct member, * psycopg/lobject.h (lobjectObject): remove "mode" struct member,

View File

@ -521,6 +521,7 @@ psyco_curs_executemany(cursorObject *self, PyObject *args, PyObject *kwargs)
while ((v = PyIter_Next(vars)) != NULL) { while ((v = PyIter_Next(vars)) != NULL) {
if (_psyco_curs_execute(self, operation, v, 0) == 0) { if (_psyco_curs_execute(self, operation, v, 0) == 0) {
Py_DECREF(v); Py_DECREF(v);
Py_XDECREF(iter);
return NULL; return NULL;
} }
else { else {