summaryrefslogtreecommitdiff
path: root/ext/pgsql/pgsql.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-11-03 00:51:53 +0000
committerZeev Suraski <zeev@php.net>2000-11-03 00:51:53 +0000
commite560ecfa47b8238fe34a51c400b80794b250c2b8 (patch)
treeffddd88265c73a57f70d6c2bd1ad18c38a958523 /ext/pgsql/pgsql.c
parent139d5c102bdc9bdb75162ed40d0b18eaaf454818 (diff)
downloadphp-git-e560ecfa47b8238fe34a51c400b80794b250c2b8.tar.gz
Fix pg_close()
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 68e53fedb1..69d91bfa07 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -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;
}
/* }}} */