From 79ebfe382b8015ea812b6bbc403f9184fa3e4ffe Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Mon, 8 May 2006 14:33:00 +0000 Subject: Fixed memory leaks when working with cursors in PDO PostgreSQL driver. --- ext/pdo_pgsql/pgsql_driver.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/pdo_pgsql/pgsql_driver.c') diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 7b1561506a..ed28052d2c 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -229,6 +229,9 @@ static int pgsql_handle_preparer(pdo_dbh_t *dbh, const char *sql, long sql_len, PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL; if (scrollable) { + if (S->cursor_name) { + efree(S->cursor_name); + } /* TODO: check how scrollable cursors related to prepared statements */ spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt); } -- cgit v1.2.1