if(!check_params()) { failed = true; goto fail; } if(some_other_check()) { failed = true; goto fail; } if(token_length == 0) { goto fail; // oops, forgot to set failed } ...check the token... fail: if(failed) { return auth_failure; }