]> granicus.if.org Git - php/commitdiff
Attemt to fix a lot of bug reports (5582,5614,5633,60,6181,6202) on crashes with...
authorFrank M. Kromann <fmk@php.net>
Thu, 31 Aug 2000 19:25:31 +0000 (19:25 +0000)
committerFrank M. Kromann <fmk@php.net>
Thu, 31 Aug 2000 19:25:31 +0000 (19:25 +0000)
ext/mssql/php_mssql.c

index ed237fc11adde3344b6cd22b6b2bc6e0d418c4c4..a39237335f9c890e0db883efa7df5eb6b9613583 100644 (file)
@@ -436,6 +436,7 @@ void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        new_le.type = le_plink;
                        new_le.ptr = mssql_ptr;
                        if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, &new_le, sizeof(list_entry), NULL)==FAILURE) {
+                               new_le.refcount++;
                                efree(mssql_ptr);
                                efree(hashed_details);
                                dbfreelogin(mssql.login);
@@ -552,6 +553,7 @@ void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                new_index_ptr.ptr = (void *) return_value->value.lval;
                new_index_ptr.type = le_index_ptr;
                if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) {
+                       new_index_ptr.refcount++;
                        efree(hashed_details);
                        RETURN_FALSE;
                }
@@ -990,6 +992,7 @@ PHP_FUNCTION(mssql_fetch_row)
                *field_content = result->data[result->cur_row][i];
                ZVAL_COPY_CTOR(field_content);
                zend_hash_index_update(return_value->value.ht, i, (void *) &field_content, sizeof(zval *), NULL);
+               field_content->refcount++;
        }
        result->cur_row++;
 }
@@ -1028,7 +1031,9 @@ static void php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS)
                        tmp->value.str.val = php_addslashes(tmp->value.str.val, tmp->value.str.len, &tmp->value.str.len,1);
                }
                zend_hash_index_update(return_value->value.ht, i, (void *) &tmp, sizeof(zval *), NULL);
+               tmp->refcount++;
                zend_hash_update(return_value->value.ht, result->fields[i].name, strlen(result->fields[i].name)+1, (void *) &tmp, sizeof(zval *), NULL);
+               tmp->refcount++;
        }
        result->cur_row++;
 }