Commit 71593dfe authored by Yang Tse's avatar Yang Tse
Browse files

OOM handling fix
parent 0f4a91af
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -461,15 +461,17 @@ CURLcode Curl_rtsp(struct connectdata *conn, bool *done)
      if(!Curl_checkheaders(data, "Content-Type:")) {
        result = Curl_add_bufferf(req_buffer,
                                  "Content-Type: text/parameters\r\n");
      }
        if(result)
          return result;
      }
    }

    if(rtspreq == RTSPREQ_ANNOUNCE) {
      if(!Curl_checkheaders(data, "Content-Type:")) {
        result = Curl_add_bufferf(req_buffer,
                                  "Content-Type: application/sdp\r\n");
        if(result)
          return result;
      }
    }

+8 −2
Original line number Diff line number Diff line
@@ -4321,13 +4321,19 @@ static CURLcode set_userpass(struct connectdata *conn,
       !conn->bits.user_passwd) {

    conn->user = strdup(CURL_DEFAULT_USER);
    if(conn->user)
      conn->passwd = strdup(CURL_DEFAULT_PASSWORD);
    else
      conn->passwd = NULL;
    /* This is the default password, so DON'T set conn->bits.user_passwd */
  }
  else {
    /* store user + password, zero-length if not set */
    conn->user = strdup(user);
    if(conn->user)
      conn->passwd = strdup(passwd);
    else
      conn->passwd = NULL;
  }
  if(!conn->user || !conn->passwd)
    return CURLE_OUT_OF_MEMORY;