Skip to content

Commit

Permalink
Fixed use uninitlized value
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Jan 8, 2014
1 parent a7ecb23 commit c4db711
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions responses/yaf_response_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,14 @@ PHP_METHOD(yaf_response_http, setAllHeaders) {
*/
PHP_METHOD(yaf_response_http, getHeader) {
zval *header = NULL;
char *name;
uint name_len;
char *name = NULL;
uint name_len = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
return;
}

if (!name_len) {
header = yaf_response_get_header(getThis(), NULL, 0 TSRMLS_CC);
} else {
header = yaf_response_get_header(getThis(), name, name_len TSRMLS_CC);
}
header = yaf_response_get_header(getThis(), name, name_len TSRMLS_CC);

if (header) {
RETURN_ZVAL(header, 1, 0);
Expand Down

0 comments on commit c4db711

Please sign in to comment.