Skip to content

Commit

Permalink
fsm: Don't ignore return value in fsm__apply.
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
  • Loading branch information
Mathieu Borderé committed Nov 17, 2022
1 parent fdf7742 commit 71979c5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static int fsm__apply(struct raft_fsm *fsm,
int rc;
rc = command__decode(buf, &type, &command);
if (rc != 0) {
// errorf(f->logger, "fsm: decode command: %d", rc);
tracef("fsm: decode command: %d", rc);
goto err;
}

Expand All @@ -334,17 +334,12 @@ static int fsm__apply(struct raft_fsm *fsm,
break;
default:
rc = RAFT_MALFORMED;
goto err_after_command_decode;
break;
}
raft_free(command);

*result = NULL;

return 0;

err_after_command_decode:
raft_free(command);
err:
*result = NULL;
return rc;
}

Expand Down

0 comments on commit 71979c5

Please sign in to comment.