Commit 99eafc49 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

security:choose_mech fix DEAD CODE warning

... by removing the "do {} while (0)" block.

Coverity CID 1306669
parent 45bad4ac
Loading
Loading
Loading
Loading
+43 −46
Original line number Diff line number Diff line
@@ -480,7 +480,6 @@ static CURLcode choose_mech(struct connectdata *conn)
  void *tmp_allocation;
  const struct Curl_sec_client_mech *mech = &Curl_krb5_client_mech;

  do {
  tmp_allocation = realloc(conn->app_data, mech->size);
  if(tmp_allocation == NULL) {
    failf(data, "Failed realloc of size %u", mech->size);
@@ -494,7 +493,7 @@ static CURLcode choose_mech(struct connectdata *conn)
    if(ret) {
      infof(data, "Failed initialization for %s. Skipping it.\n",
            mech->name);
        continue;
      return CURLE_FAILED_INIT;
    }
  }

@@ -521,15 +520,14 @@ static CURLcode choose_mech(struct connectdata *conn)
      }
      break;
    }
      continue;
    return CURLE_LOGIN_DENIED;
  }

  /* Authenticate */
  ret = mech->auth(conn->app_data, conn);

    if(ret == AUTH_CONTINUE)
      continue;
    else if(ret != AUTH_OK) {
  if(ret != AUTH_CONTINUE) {
    if(ret != AUTH_OK) {
      /* Mechanism has dumped the error to stderr, don't error here. */
      return -1;
    }
@@ -545,8 +543,7 @@ static CURLcode choose_mech(struct connectdata *conn)
    /* Set the requested protection level */
    /* BLOCKING */
    (void)sec_set_protection_level(conn);

  } WHILE_FALSE;
  }

  return CURLE_OK;
}