Skip to content

Commit

Permalink
ovn-controller.c: Fix memory leak in addr_sets_update.
Browse files Browse the repository at this point in the history
The asan log:
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x534cb7 in calloc (/home/hanzhou/src/ovn/_build_as/controller/ovn-controller+0x534cb7)
    #1 0x73bf9e in xcalloc__ /home/hanzhou/src/ovs/_build/../lib/util.c:121:31
    #2 0x73bf9e in xzalloc__ /home/hanzhou/src/ovs/_build/../lib/util.c:131:12
    #3 0x73bf9e in xzalloc /home/hanzhou/src/ovs/_build/../lib/util.c:165:12
    #4 0x5f7629 in addr_sets_update /home/hanzhou/src/ovn/_build_as/../controller/ovn-controller.c:1484:21
    #5 0x5f7629 in addr_sets_sb_address_set_handler /home/hanzhou/src/ovn/_build_as/../controller/ovn-controller.c:1531:5
    #6 0x65b140 in engine_compute /home/hanzhou/src/ovn/_build_as/../lib/inc-proc-eng.c:406:28
    #7 0x65b140 in engine_run_node /home/hanzhou/src/ovn/_build_as/../lib/inc-proc-eng.c:468:14
    #8 0x65b140 in engine_run /home/hanzhou/src/ovn/_build_as/../lib/inc-proc-eng.c:493:9
    #9 0x5ef9c1 in main /home/hanzhou/src/ovn/_build_as/../controller/ovn-controller.c
    #10 0x7f3092dda1a1 in __libc_start_main (/lib64/libc.so.6+0x281a1)

Reported-by: Numan Siddique <numans@ovn.org>
Fixes: 6a60154 ("ovn-controller: Handle addresses deletion in address set incrementally.")
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
hzhou8 committed Feb 24, 2022
1 parent cd8b443 commit ad586d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions controller/ovn-controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,7 @@ addr_sets_update(const struct sbrec_address_set_table *address_set_table,
* For example, ff::01 is changed to ff::00:01. */
free(as_diff);
expr_constant_set_destroy(cs_new);
free(cs_new);
continue;
}
shash_add(updated, as->name, as_diff);
Expand Down

0 comments on commit ad586d4

Please sign in to comment.