]> granicus.if.org Git - php/commitdiff
I added code to up the reference count of the database connection
authorPaul Moosman <pwmoosman@php.net>
Mon, 23 Jul 2001 16:10:10 +0000 (16:10 +0000)
committerPaul Moosman <pwmoosman@php.net>
Mon, 23 Jul 2001 16:10:10 +0000 (16:10 +0000)
reference. This change fixes bug #11489 in php version 4.0.6.
I derived this fix from the my_sql module.

ext/sybase_ct/php_sybase_ct.c

index bd7090cf4d7bb576909afd720f35c9079b7dd141..c09720a9000d0ffee0ffc72abc9bec4c0c90f96d 100644 (file)
@@ -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));
 }