Skip to content

Commit

Permalink
raft: Fix error leak on failure while saving snapshot.
Browse files Browse the repository at this point in the history
Error should be destroyed before return.

Fixes: 1b1d2e6 ("ovsdb: Introduce experimental support for clustered databases.")
Acked-by: Han Zhou <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Oct 27, 2020
1 parent 50f603d commit 91bdb33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ovsdb/raft.c
Original file line number Diff line number Diff line change
Expand Up @@ -3987,7 +3987,7 @@ raft_handle_install_snapshot_request__(
struct ovsdb_error *error = raft_save_snapshot(raft, new_log_start,
&new_snapshot);
if (error) {
char *error_s = ovsdb_error_to_string(error);
char *error_s = ovsdb_error_to_string_free(error);
VLOG_WARN("could not save snapshot: %s", error_s);
free(error_s);
return false;
Expand Down

0 comments on commit 91bdb33

Please sign in to comment.