From b40dca6b14d254b7260774c8dee3d32caedfdc07 Mon Sep 17 00:00:00 2001 From: BlackLight Date: Thu, 16 Sep 2010 17:24:53 +0200 Subject: [PATCH] Fixed a leak in postgresql.c --- postgresql.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/postgresql.c b/postgresql.c index 273ab34..eee9964 100644 --- a/postgresql.c +++ b/postgresql.c @@ -116,8 +116,16 @@ postgresql_fetch_row ( PSQL_result *res ) void postgresql_free_result ( PSQL_result *res ) { + int i, j, ntuples; + if ( res ) { + ntuples = PQntuples ( res->res ); + + for ( i=0; i < ntuples; i++ ) + free ( res->rows[i] ); + free ( res->rows ); + PQclear ( res->res ); free ( res ); }