]> granicus.if.org Git - php/commitdiff
Fix pg_close()
authorZeev Suraski <zeev@php.net>
Fri, 3 Nov 2000 00:51:53 +0000 (00:51 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 3 Nov 2000 00:51:53 +0000 (00:51 +0000)
ext/pgsql/pgsql.c

index 68e53fedb10d85c7732d824c16754624083b579c..69d91bfa071465d69c17d2621e3bb8275b4cb388 100644 (file)
@@ -486,7 +486,11 @@ PHP_FUNCTION(pg_close)
        }
        
        ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link, le_plink);
-       zend_list_delete(id);
+       zend_list_delete(Z_RESVAL_PP(pgsql_link));
+       if (Z_RESVAL_PP(pgsql_link)==PGG(default_link)) {
+               zend_list_delete(PGG(default_link));
+       }
+
        RETURN_TRUE;
 }
 /* }}} */