memory leak in ODBC driver

From: "Scot Loach" <sloach(at)sandvine(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: memory leak in ODBC driver
Date: 2004-11-27 18:11:22
Message-ID: DF02F5FE21007A44B8464101EFA761EF255AA8@exchange.sandvine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

There is a 16-byte leak for every statement handle that has SQLFetch called on it.
I have tracked this leak down to its source:
SC_Fetch calls extend_getdata_info, which allocates memory for the stmt.getdata_info.
However, this memory is never freed when the statement is deallocated.

This patch seems to fix the problem - however I don't know enough about the internals of the driver to really understand if this is the correct or safe fix.
Can one of the developers help me out here?

--- statement.c.old 2004-11-27 13:07:57.000000000 -0500
+++ statement.c 2004-11-27 13:09:37.000000000 -0500
@@ -354,6 +354,8 @@
if (self->callbacks)
free(self->callbacks);

+ GDATA_unbind_cols(SC_get_GDTI(self), TRUE);
+
DELETE_STMT_CS(self);
free(self);

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2004-11-27 23:19:49 Re: memory leak in ODBC driver
Previous Message Amir Zicherman 2004-11-24 06:52:34 autocommit off