]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #24284 (Fixed memory leak inside pg_ping())
authorIlia Alshanetsky <iliaa@php.net>
Sun, 22 Jun 2003 16:48:16 +0000 (16:48 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 22 Jun 2003 16:48:16 +0000 (16:48 +0000)
NEWS
ext/pgsql/pgsql.c

diff --git a/NEWS b/NEWS
index 17ff59b062b402515d8aa2568aa76192675e64f7..a77b579e57cbd42a2f56cd25c1886082c62a2487 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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)
index 20022607ea9d755eb113457832eb05f3e3edd8f2..a57ec168a7d44f6eedb4779163652467e6dcb197 100644 (file)
@@ -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)