diff --git a/lib/setopt.c b/lib/setopt.c index e67a3c8beb..07fa60be7e 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2024,6 +2024,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, /* * String to set in the HTTP Referer: field. */ + Curl_bufref_free(&data->state.referer); result = Curl_setstropt(&s->str[STRING_SET_REFERER], ptr); break;