Skip to content

Commit

Permalink
revert unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Feb 16, 2016
1 parent cccf929 commit b91f0f2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/php/ext/grpc/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array) {
memcpy(str_val, elem->value, elem->value_length);
if (zend_hash_find(array_hash, str_key, key_len, (void **)data) ==
SUCCESS) {
zend_throw_exception(zend_exception_get_default(),
"Metadata hash somehow contains wrong types.",
1 TSRMLS_CC);
if (Z_TYPE_P(*data) != IS_ARRAY) {
zend_throw_exception(zend_exception_get_default(),
"Metadata hash somehow contains wrong types.",
1 TSRMLS_CC);
efree(str_key);
efree(str_val);
return NULL;
}
add_next_index_stringl(*data, str_val, elem->value_length, false);
} else {
MAKE_STD_ZVAL(inner_array);
array_init(inner_array);
Expand Down

0 comments on commit b91f0f2

Please sign in to comment.