From: Michael Wallner Date: Wed, 14 Sep 2016 07:05:13 +0000 (+0200) Subject: coverity fixes X-Git-Tag: RELEASE_3_1_0_RC1~29 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=40d6f0ca483e19b18982d135e5ea2c7426e832a6 coverity fixes --- diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index 69b6ca7..cca6a27 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -1633,7 +1633,7 @@ static ZEND_RESULT_CODE php_http_curlm_option_set_use_eventloop(php_http_option_ php_http_client_t *client = userdata; php_http_client_curl_ops_t *ev_ops = NULL; - if (Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), php_http_client_curl_user_get_class_entry())) { + if (value && Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), php_http_client_curl_user_get_class_entry())) { ev_ops = php_http_client_curl_user_ops_get(); #if PHP_HTTP_HAVE_EVENT } else if (value && zend_is_true(value)) { diff --git a/src/php_http_client_curl_user.c b/src/php_http_client_curl_user.c index 66edae6..d345e27 100644 --- a/src/php_http_client_curl_user.c +++ b/src/php_http_client_curl_user.c @@ -106,7 +106,7 @@ static int php_http_client_curl_user_socket(CURL *easy, curl_socket_t sock, int return -1; } - if (action == CURL_POLL_REMOVE && ev) { + if (action == CURL_POLL_REMOVE) { php_stream_close(ev->socket); efree(ev); curl_multi_assign(curl->handle->multi, sock, NULL); diff --git a/src/php_http_url.c b/src/php_http_url.c index 1a5f6ae..b828c46 100644 --- a/src/php_http_url.c +++ b/src/php_http_url.c @@ -1078,7 +1078,7 @@ static const char *parse_ip6(struct parse_state *state, const char *ptr) } efree(addr); } else { - pos = tmp ? tmp - ptr : end - ptr; + pos = end - ptr; error = "expected ']'"; }