diff options
-rw-r--r-- | ext/curl/interface.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ef0eee9578..11b6127051 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -3429,8 +3429,12 @@ PHP_FUNCTION(curl_error) RETURN_FALSE; } - ch->err.str[CURL_ERROR_SIZE] = 0; - RETURN_STRING(ch->err.str); + if (ch->err.no) { + ch->err.str[CURL_ERROR_SIZE] = 0; + RETURN_STRING(ch->err.str); + } else { + RETURN_EMPTY_STRING(); + } } /* }}} */ |