From: Paul Moosman Date: Mon, 23 Jul 2001 16:10:10 +0000 (+0000) Subject: I added code to up the reference count of the database connection X-Git-Tag: PRE_TSRM_MERGE_PATCH~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22a8e9536ad16b4978586efb36b811dcfc855e26;p=php I added code to up the reference count of the database connection reference. This change fixes bug #11489 in php version 4.0.6. I derived this fix from the my_sql module. --- diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index bd7090cf4d..c09720a900 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -640,6 +640,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) link = (int) index_ptr->ptr; ptr = zend_list_find(link, &type); /* check if the link is still there */ if (ptr && (type==le_link || type==le_plink)) { + zend_list_addref(link); return_value->value.lval = SybCtG(default_link) = link; return_value->type = IS_RESOURCE; efree(hashed_details); @@ -678,6 +679,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } efree(hashed_details); SybCtG(default_link)=return_value->value.lval; + zend_list_addref(SybCtG(default_link)); }