Patch to fix memory leak in fetch in Python interface.

From: Stephen Robert Norris <srn(at)commsecure(dot)com(dot)au>
To: pgsql-patches(at)postgresql(dot)org
Subject: Patch to fix memory leak in fetch in Python interface.
Date: 2001-10-17 22:46:27
Message-ID: 1003358787.31478.1.camel@ws12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

This stops the interface from leaking the row tuples (and thus the
results of every fetch).

Stephen

--- pgmodule.c Wed Oct 17 17:07:05 2001
+++ pgmodule.c.orig Thu Oct 18 08:39:52 2001
@@ -561,11 +561,11 @@
}
else
str = PyString_FromString(PQgetvalue(self->last_result,
self->current_row, j));
- PyTuple_SET_ITEM(rowtuple, j, str);
+ Py_DECREF(str);
+ PyTuple_SET_ITEM(rowtuple, j, Py_None);
}

PyList_Append(reslist, rowtuple);
- Py_DECREF(rowtuple);
self->current_row++;
}

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Stephen Robert Norris 2001-10-17 22:56:47 Re: Patch to fix memory leak in fetch in Python interface.
Previous Message Marko Kreen 2001-10-17 22:31:34 Re: Ant configuration