mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
parent
f39b8a1174
commit
36542b7349
16 changed files with 67 additions and 82 deletions
14
lib/setopt.c
14
lib/setopt.c
|
|
@ -54,6 +54,7 @@
|
|||
#include "tftp.h"
|
||||
#include "strdup.h"
|
||||
#include "escape.h"
|
||||
#include "bufref.h"
|
||||
|
||||
static CURLcode setopt_set_timeout_sec(timediff_t *ptimeout_ms, long secs)
|
||||
{
|
||||
|
|
@ -1971,12 +1972,8 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
|
|||
/*
|
||||
* The URL to fetch.
|
||||
*/
|
||||
if(data->state.url_alloc) {
|
||||
Curl_safefree(data->state.url);
|
||||
data->state.url_alloc = FALSE;
|
||||
}
|
||||
result = Curl_setstropt(&s->str[STRING_SET_URL], ptr);
|
||||
data->state.url = s->str[STRING_SET_URL];
|
||||
Curl_bufref_set(&data->state.url, s->str[STRING_SET_URL], 0, NULL);
|
||||
break;
|
||||
|
||||
case CURLOPT_USERPWD:
|
||||
|
|
@ -2063,12 +2060,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
|
|||
/*
|
||||
* pass CURLU to set URL
|
||||
*/
|
||||
if(data->state.url_alloc) {
|
||||
Curl_safefree(data->state.url);
|
||||
data->state.url_alloc = FALSE;
|
||||
}
|
||||
else
|
||||
data->state.url = NULL;
|
||||
Curl_bufref_free(&data->state.url);
|
||||
Curl_safefree(s->str[STRING_SET_URL]);
|
||||
s->uh = (CURLU *)ptr;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue