Commit 0c8e36c1 authored by Yang Tse's avatar Yang Tse
Browse files

http_proxy.c: fix OOM handling

parent 862bb7ba
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -128,12 +128,15 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
          aprintf("%s%s%s:%hu", conn->bits.ipv6_ip?"[":"",
                  hostname, conn->bits.ipv6_ip?"]":"",
                  remote_port);
        if(!hostheader)
        if(!hostheader) {
          free(req_buffer);
          return CURLE_OUT_OF_MEMORY;
        }

        if(!Curl_checkheaders(data, "Host:")) {
          host = aprintf("Host: %s\r\n", hostheader);
          if(!host) {
            free(hostheader);
            free(req_buffer);
            return CURLE_OUT_OF_MEMORY;
          }