Commit 08d1da10 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

check malloc() return code

parent 9e31a053
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -1430,7 +1430,7 @@ CURLcode Curl_http(struct connectdata *conn)
        char *newurl;
        
        newurl = malloc(urllen + newlen - currlen + 1);

        if(newurl) {
          /* copy the part before the host name */
          memcpy(newurl, url, ptr - url);
          /* append the new host name instead of the old */
@@ -1444,6 +1444,9 @@ CURLcode Curl_http(struct connectdata *conn)
          data->change.url = newurl;
          data->change.url_alloc = TRUE;
        }
        else
          return CURLE_OUT_OF_MEMORY;
      }
    }
    ppath = data->change.url;
  }