Skip to content

Commit e845320

Browse files
committed
Fixed bug #72175
Make sure we don't close the connection we're trying to reuse...
1 parent f71eab9 commit e845320

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

interbase.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,15 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
939939

940940
xlink = (zend_resource*) le->ptr;
941941
if ((!persistent && xlink->type == le_link) || xlink->type == le_plink) {
942-
if (IBG(default_link)) {
943-
zend_list_close(IBG(default_link));
942+
if (IBG(default_link) != xlink) {
943+
GC_REFCOUNT(xlink)++;
944+
if (IBG(default_link)) {
945+
zend_list_delete(IBG(default_link));
946+
}
947+
IBG(default_link) = xlink;
944948
}
945-
xlink->gc.refcount++;
946-
xlink->gc.refcount++;
947-
IBG(default_link) = xlink;
948-
RETVAL_RES(xlink);
949+
GC_REFCOUNT(xlink)++;
950+
RETURN_RES(xlink);
949951
} else {
950952
zend_hash_str_del(&EG(regular_list), hash, sizeof(hash)-1);
951953
}

0 commit comments

Comments
 (0)