]> granicus.if.org Git - php/commitdiff
Remove passwd handler from struct when not needed
authorPierrick Charron <pierrick@php.net>
Wed, 2 Jan 2013 02:12:02 +0000 (21:12 -0500)
committerPierrick Charron <pierrick@php.net>
Wed, 2 Jan 2013 02:12:02 +0000 (21:12 -0500)
CURLOPT_PASSWDFUNCTION was removed in cURL 7.15.5, the passwd field
will not be used for version greater than this one

ext/curl/interface.c
ext/curl/php_curl.h

index 125094c53a75676b8371a9b3757d5c419423e1d1..e0c95efed52ad8eaf628ce9f29671676ba16496b 100644 (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);
        }
index 3ae70602887f115be81319ae06a8ee7a0f52e400..5c24fc13027106f1f9d3ceb513b7d27adcdf5bc5 100644 (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 */