Skip to content

Commit

Permalink
ovsdb: Fix asan warning on ovsdb fatal errors.
Browse files Browse the repository at this point in the history
Calls to ovs_fatal from check_ovsdb_error would trigger an asan splat in
the ci. This is a harmless memory leak as the process would always
immediately terminate anyways.

==245041==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 in malloc
    openvswitch#1 in xmalloc__ lib/util.c:141:15
    openvswitch#2 in xmalloc lib/util.c:176:12
    openvswitch#3 in ovsdb_error_valist lib/ovsdb-error.c:40:33
    #4 in ovsdb_error lib/ovsdb-error.c:55:13
    #5 in ovsdb_log_open ovsdb/log.c
    openvswitch#6 in do_db_name ovsdb/ovsdb-tool.c:482:23
    #7 in ovs_cmdl_run_command__ lib/command-line.c:247:17
    #8 in main ovsdb/ovsdb-tool.c:82:5

Signed-off-by: Mike Pattrick <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
mkp-rh authored and ovsrobot committed Jan 7, 2025
1 parent 41efbd7 commit 9ec864e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ovsdb/ovsdb-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ static void
check_ovsdb_error(struct ovsdb_error *error)
{
if (error) {
ovs_fatal(0, "%s", ovsdb_error_to_string(error));
ovs_fatal(0, "%s", ovsdb_error_to_string_free(error));
}
}

Expand Down
2 changes: 1 addition & 1 deletion ovsdb/ovsdb-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static void
check_ovsdb_error(struct ovsdb_error *error)
{
if (error) {
ovs_fatal(0, "%s", ovsdb_error_to_string(error));
ovs_fatal(0, "%s", ovsdb_error_to_string_free(error));
}
}

Expand Down

0 comments on commit 9ec864e

Please sign in to comment.