]> granicus.if.org Git - php/commitdiff
Don't increase the refcount of id, if we already have increased the refcount
authorSascha Schumann <sas@php.net>
Wed, 13 Dec 2000 12:26:25 +0000 (12:26 +0000)
committerSascha Schumann <sas@php.net>
Wed, 13 Dec 2000 12:26:25 +0000 (12:26 +0000)
of the same id before.

PR: #8225

ext/pgsql/pgsql.c

index 11722eae0a473cacad9742a5e07d59a4b1181151..76bd96216dbf7691c603ce11f85df10aafca21bd 100644 (file)
@@ -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);
+    }
 }