Remove passwd handler from struct when not needed

CURLOPT_PASSWDFUNCTION was removed in cURL 7.15.5, the passwd field
will not be used for version greater than this one
This commit is contained in:
Pierrick Charron 2013-01-01 21:12:02 -05:00
parent a666285bc2
commit 343a9199bb
2 changed files with 4 additions and 0 deletions

View file

@ -3267,9 +3267,11 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
if (ch->handlers->write_header->func_name) {
zval_ptr_dtor(&ch->handlers->write_header->func_name);
}
#if CURLOPT_PASSWDFUNCTION != 0
if (ch->handlers->passwd) {
zval_ptr_dtor(&ch->handlers->passwd);
}
#endif
if (ch->handlers->std_err) {
zval_ptr_dtor(&ch->handlers->std_err);
}

View file

@ -135,7 +135,9 @@ typedef struct {
php_curl_write *write;
php_curl_write *write_header;
php_curl_read *read;
#if CURLOPT_PASSWDFUNCTION != 0
zval *passwd;
#endif
zval *std_err;
php_curl_progress *progress;
#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */