diff options
-rw-r--r-- | ext/curl/curl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 53caad3f12..22544dd778 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -169,8 +169,9 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); RETURN_FALSE; \ } \ \ - if (php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ + if (tmp_url->host || !php_memnstr(str, tmp_url->path, strlen(tmp_url->path), str + len)) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Url '%s' contains unencoded control characters.", str); \ + php_url_free(tmp_url); \ RETURN_FALSE; \ } \ \ |