Message ID | 20201023183010.4096868-1-i.maximets@ovn.org |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] raft: Fix error leak on failure while saving snapshot. | expand |
On Fri, Oct 23, 2020 at 11:30 AM Ilya Maximets <i.maximets@ovn.org> wrote: > > Error should be destroyed before return. > > Fixes: 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases.") > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > --- > ovsdb/raft.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ovsdb/raft.c b/ovsdb/raft.c > index 708b0624c..816f69e22 100644 > --- a/ovsdb/raft.c > +++ b/ovsdb/raft.c > @@ -3986,7 +3986,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; > -- > 2.25.4 > Acked-by: Han Zhou <hzhou@ovn.org>
On 10/26/20 2:05 AM, Han Zhou wrote: > > > On Fri, Oct 23, 2020 at 11:30 AM Ilya Maximets <i.maximets@ovn.org <mailto:i.maximets@ovn.org>> wrote: >> >> Error should be destroyed before return. >> >> Fixes: 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases.") >> Signed-off-by: Ilya Maximets <i.maximets@ovn.org <mailto:i.maximets@ovn.org>> >> --- >> ovsdb/raft.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/ovsdb/raft.c b/ovsdb/raft.c >> index 708b0624c..816f69e22 100644 >> --- a/ovsdb/raft.c >> +++ b/ovsdb/raft.c >> @@ -3986,7 +3986,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; >> -- >> 2.25.4 >> > > Acked-by: Han Zhou <hzhou@ovn.org <mailto:hzhou@ovn.org>> Thanks! Applied to master and backported down to 2.9. Best regards, Ilya Maximets.
diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 708b0624c..816f69e22 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -3986,7 +3986,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;
Error should be destroyed before return. Fixes: 1b1d2e6daa56 ("ovsdb: Introduce experimental support for clustered databases.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- ovsdb/raft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)