[ovs-dev] [PATCH ovn 04/14] actions: Fix leak of select group members.

Ilya Maximets i.maximets at ovn.org
Fri Nov 20 00:17:14 UTC 2020


'dsts' should be freed in case of any error.

  Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x502378 in realloc (/tests/ovstest+0x502378)
    #1 0x622826 in xrealloc /lib/util.c:149:9
    #2 0x8194f4 in parse_select_action /lib/actions.c:1185:20
    #3 0x814f49 in parse_set_action /lib/actions.c:3499:13
    #4 0x814341 in parse_action /lib/actions.c:3554:9
    #5 0x8139ef in parse_actions /lib/actions.c:3643:14
    #6 0x8136a3 in ovnacts_parse /lib/actions.c:3678:9
    #7 0x813c80 in ovnacts_parse_string /lib/actions.c:3705:5
    #8 0x53a4e8 in test_parse_actions /tests/test-ovn.c:1321:17
    #9 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #10 0x537c75 in test_ovn_main /tests/test-ovn.c:1630:5
    #11 0x54e7a8 in ovs_cmdl_run_command__ /lib/command-line.c:247:17
    #12 0x537359 in main /tests/ovstest.c:133:9
    #13 0x7f9ce05ba1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)

CC: Han Zhou <hzhou at ovn.org>
Fixes: 85b3544aabb2 ("ovn-controller: A new action "select".")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---
 lib/actions.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/actions.c b/lib/actions.c
index d98af0f91..ea949e1bd 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1188,6 +1188,7 @@ parse_select_action(struct action_context *ctx, struct expr_field *res_field)
     }
     if (n_dsts <= 1) {
         lexer_syntax_error(ctx->lexer, "expecting at least 2 group members");
+        free(dsts);
         return;
     }
 
-- 
2.25.4



More information about the dev mailing list