Commit 6afe70a0 authored by Michael Kaufmann's avatar Michael Kaufmann
Browse files

Curl_follow: Always free the passed new URL

Closes #3124
parent 3455b4b3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1725,6 +1725,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
            if(!drc || (drc == CURLE_SEND_ERROR)) {
              follow = FOLLOW_RETRY;
              drc = Curl_follow(data, newurl, follow);
              newurl = NULL; /* freed by Curl_follow() */
              if(!drc) {
                multistate(data, CURLM_STATE_CONNECT);
                rc = CURLM_CALL_MULTI_PERFORM;
+3 −1
Original line number Diff line number Diff line
@@ -1500,8 +1500,10 @@ CURLcode Curl_follow(struct Curl_easy *data,
        }

        data->change.referer = strdup(data->change.url);
        if(!data->change.referer)
        if(!data->change.referer) {
          free(newurl);
          return CURLE_OUT_OF_MEMORY;
        }
        data->change.referer_alloc = TRUE; /* yes, free this later */
      }
    }