- Fix mem. leak

This commit is contained in:
Felipe Pena 2010-04-21 12:52:24 +00:00
parent febee11285
commit 623a25728a

View File

@ -1663,13 +1663,13 @@ PHP_FUNCTION(mysqli_options)
{
MY_MYSQL *mysql;
zval *mysql_link = NULL;
zval *mysql_value;
zval **mysql_value;
long mysql_option;
unsigned int l_value;
long ret;
int expected_type;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olz", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OlZ", &mysql_link, mysqli_link_class_entry, &mysql_option, &mysql_value) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_INITIALIZED);
@ -1680,13 +1680,13 @@ PHP_FUNCTION(mysqli_options)
}
}
expected_type = mysqli_options_get_option_zval_type(mysql_option);
if (expected_type != Z_TYPE_P(mysql_value)) {
if (expected_type != Z_TYPE_PP(mysql_value)) {
switch (expected_type) {
case IS_STRING:
convert_to_string_ex(&mysql_value);
convert_to_string_ex(mysql_value);
break;
case IS_LONG:
convert_to_long_ex(&mysql_value);
convert_to_long_ex(mysql_value);
break;
default:
break;
@ -1694,10 +1694,10 @@ PHP_FUNCTION(mysqli_options)
}
switch (expected_type) {
case IS_STRING:
ret = mysql_options(mysql->mysql, mysql_option, Z_STRVAL_PP(&mysql_value));
ret = mysql_options(mysql->mysql, mysql_option, Z_STRVAL_PP(mysql_value));
break;
case IS_LONG:
l_value = Z_LVAL_PP(&mysql_value);
l_value = Z_LVAL_PP(mysql_value);
ret = mysql_options(mysql->mysql, mysql_option, (char *)&l_value);
break;
default: