Skip to content

Commit

Permalink
Add asserts for clang scan
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Sep 3, 2015
1 parent 6ca59f9 commit 1a07fee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/rlm_redis/cluster.c
Expand Up @@ -409,7 +409,7 @@ static cluster_rcode_t cluster_node_conf_from_redirect(uint16_t *key_slot, clust
uint16_t port;
fr_ipaddr_t ipaddr;

rad_assert(redirect->type == REDIS_REPLY_ERROR);
rad_assert(redirect && (redirect->type == REDIS_REPLY_ERROR));

p = redirect->str;
if (strncmp(REDIS_ERROR_MOVED_STR, redirect->str, sizeof(REDIS_ERROR_MOVED_STR) - 1) == 0) {
Expand Down Expand Up @@ -1834,6 +1834,8 @@ fr_redis_rcode_t fr_redis_cluster_state_next(fr_redis_cluster_state_t *state, fr
* trigger a cluster remap.
*/
case REDIS_RCODE_MOVE:
rad_assert(*reply);

if (*conn && (cluster_remap(request, cluster, *conn) != CLUSTER_OP_SUCCESS)) {
RDEBUG2("%s", fr_strerror());
}
Expand All @@ -1846,6 +1848,8 @@ fr_redis_rcode_t fr_redis_cluster_state_next(fr_redis_cluster_state_t *state, fr
{
cluster_node_t *new;

rad_assert(*reply);

fr_connection_release(state->node->pool, *conn); /* Always release the old connection */

RDEBUG("[%i] Processing redirect \"%s\"", state->node->id, (*reply)->str);
Expand Down

0 comments on commit 1a07fee

Please sign in to comment.