summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-12-13 12:26:25 +0000
committerSascha Schumann <sas@php.net>2000-12-13 12:26:25 +0000
commit08d104e04041685502301b24b80afe82674e8c02 (patch)
tree67f306472c5f2c8491d4aff5e6d56f759c02efaf /ext/pgsql
parentb2a016135e64476b27475eac6129ad6b20509805 (diff)
downloadphp-git-08d104e04041685502301b24b80afe82674e8c02.tar.gz
Don't increase the refcount of id, if we already have increased the refcount
of the same id before. PR: #8225
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/pgsql.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 11722eae0a..76bd96216d 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -117,8 +117,10 @@ static void php_pgsql_set_default_link(int id)
if (PGG(default_link)!=-1) {
zend_list_delete(PGG(default_link));
}
- PGG(default_link) = id;
- zend_list_addref(id);
+ if (PGG(default_link) != id) {
+ PGG(default_link) = id;
+ zend_list_addref(id);
+ }
}