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
    1 in xmalloc__ lib/util.c:141:15
    2 in xmalloc lib/util.c:176:12
    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
    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: Ilya Maximets <[email protected]>
  • Loading branch information
mkp-rh authored and igsilya committed Jan 10, 2025
1 parent 64364f3 commit 9c1ba8b
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 @@ -553,7 +553,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 9c1ba8b

Please sign in to comment.