summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-03-30 15:04:18 +0000
committerZeev Suraski <zeev@php.net>2001-03-30 15:04:18 +0000
commit95be023542678a40b64fd868754cf691af22b05c (patch)
tree84e5a4de8d35aa470be6b9106966aab1998f7be3
parente803bda938396d04fa11c003538f3ac381006b47 (diff)
downloadphp-git-95be023542678a40b64fd868754cf691af22b05c.tar.gz
Fix pgsql_set_Default_link()
-rw-r--r--ext/pgsql/pgsql.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 4e9755bfea..928abc1233 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -117,14 +117,14 @@ static void php_pgsql_set_default_link(int id)
{
PGLS_FETCH();
+ zend_list_addref(id); /* increase refcount for the new default link */
+
if (PGG(default_link) != -1) {
+ /* decrease refcount for the old default link */
zend_list_delete(PGG(default_link));
}
- if (PGG(default_link) != id) {
- PGG(default_link) = id;
- zend_list_addref(id);
- }
+ PGG(default_link) = id;
}