diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-06-22 16:48:16 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-06-22 16:48:16 +0000 |
commit | d74a72d58020da54c463cc75d47de1ee8e349956 (patch) | |
tree | 901ab1dd455a6424aa87b8f5c40adc56a57b1b53 | |
parent | 40d758b0199ea81159da3aae652a80caf16f5194 (diff) | |
download | php-git-d74a72d58020da54c463cc75d47de1ee8e349956.tar.gz |
MFH: Fixed bug #24284 (Fixed memory leak inside pg_ping())
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/pgsql/pgsql.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -1,7 +1,7 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 26 Jun 2003, Version 4.3.3RC2 -- dummy (remove when first entry is added) +- Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia) 19 Jun 2003, Version 4.3.3RC1 - Synchronized bundled GD library with GD 2.0.15. (Ilia) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 20022607ea..a57ec168a7 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -865,6 +865,7 @@ PHP_FUNCTION(pg_ping) zval *pgsql_link = NULL; int id = -1; PGconn *pgsql; + PGresult *res; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "r", &pgsql_link) == FAILURE) { @@ -874,7 +875,8 @@ PHP_FUNCTION(pg_ping) ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); /* ping connection */ - PQexec(pgsql, "SELECT 1;"); + res = PQexec(pgsql, "SELECT 1;"); + PQclear(res); /* check status. */ if (PQstatus(pgsql) == CONNECTION_OK) |