diff options
author | Federico Di Gregorio <fog@initd.org> | 2008-05-19 10:14:17 +0200 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2008-05-19 10:14:17 +0200 |
commit | 607319331410a21111965727ebea9ac1d9dd8f23 (patch) | |
tree | 1a34ab1b4ba31fb48500f20300b196fecf154513 | |
parent | f1fab54b978c1e6f9bb47c1b85dfff5d83f9f72b (diff) | |
download | psycopg2-607319331410a21111965727ebea9ac1d9dd8f23.tar.gz |
Fixed memory leak in executemany
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | psycopg/cursor_type.c | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -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> * psycopg/lobject.h (lobjectObject): remove "mode" struct member, diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index a17847e..5b0cd02 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -521,6 +521,7 @@ psyco_curs_executemany(cursorObject *self, PyObject *args, PyObject *kwargs) while ((v = PyIter_Next(vars)) != NULL) { if (_psyco_curs_execute(self, operation, v, 0) == 0) { Py_DECREF(v); + Py_XDECREF(iter); return NULL; } else { |