Skip to content

Commit 343a919

Browse files
committed
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
1 parent a666285 commit 343a919

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ext/curl/interface.c

+2
Original file line numberDiff line numberDiff line change
@@ -3267,9 +3267,11 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
32673267
if (ch->handlers->write_header->func_name) {
32683268
zval_ptr_dtor(&ch->handlers->write_header->func_name);
32693269
}
3270+
#if CURLOPT_PASSWDFUNCTION != 0
32703271
if (ch->handlers->passwd) {
32713272
zval_ptr_dtor(&ch->handlers->passwd);
32723273
}
3274+
#endif
32733275
if (ch->handlers->std_err) {
32743276
zval_ptr_dtor(&ch->handlers->std_err);
32753277
}

ext/curl/php_curl.h

+2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ typedef struct {
135135
php_curl_write *write;
136136
php_curl_write *write_header;
137137
php_curl_read *read;
138+
#if CURLOPT_PASSWDFUNCTION != 0
138139
zval *passwd;
140+
#endif
139141
zval *std_err;
140142
php_curl_progress *progress;
141143
#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */

0 commit comments

Comments
 (0)