OVN unit tests highlight this: ERROR: LeakSanitizer: detected memory leaks Direct leak of 1344 byte(s) in 1 object(s) allocated from: #0 0x4db0b7 in calloc (/root/master-ovn/ovs/ovsdb/ovsdb-server+0x4db0b7) #1 0x5c2162 in xcalloc__ /root/master-ovn/ovs/lib/util.c:124:31 #2 0x5c221c in xcalloc /root/master-ovn/ovs/lib/util.c:161:12 #3 0x54afbc in ovsdb_condition_diff /root/master-ovn/ovs/ovsdb/condition.c:527:21 #4 0x529da6 in ovsdb_monitor_table_condition_update /root/master-ovn/ovs/ovsdb/monitor.c:824:5 #5 0x524fa4 in ovsdb_jsonrpc_parse_monitor_cond_change_request /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:1557:13 #6 0x5235c3 in ovsdb_jsonrpc_monitor_cond_change /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:1624:25 #7 0x5217f2 in ovsdb_jsonrpc_session_got_request /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:1034:17 #8 0x520ee6 in ovsdb_jsonrpc_session_run /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:572:17 #9 0x51ffbe in ovsdb_jsonrpc_session_run_all /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:602:21 #10 0x51fbcf in ovsdb_jsonrpc_server_run /root/master-ovn/ovs/ovsdb/jsonrpc-server.c:417:9 #11 0x517550 in main_loop /root/master-ovn/ovs/ovsdb/ovsdb-server.c:224:9 #12 0x512e80 in main /root/master-ovn/ovs/ovsdb/ovsdb-server.c:507:5 #13 0x7f9ecf675b74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
Signed-off-by: Xavier Simonart <xsimo...@redhat.com> --- ovsdb/monitor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c index 9829cd39c..32d2bca7f 100644 --- a/ovsdb/monitor.c +++ b/ovsdb/monitor.c @@ -1194,7 +1194,8 @@ ovsdb_monitor_compose_cond_change_update( unsigned long int *changed = xmalloc(bitmap_n_bytes(max_columns)); SHASH_FOR_EACH (node, &dbmon->tables) { - struct ovsdb_condition *old_condition, *new_condition, *diff_condition; + struct ovsdb_condition *old_condition, *new_condition; + struct ovsdb_condition *diff_condition = NULL; struct ovsdb_monitor_table *mt = node->data; struct json *table_json = NULL; struct ovsdb_row *row; @@ -1206,6 +1207,10 @@ ovsdb_monitor_compose_cond_change_update( &diff_condition) || !ovsdb_condition_cmp_3way(old_condition, new_condition)) { /* Nothing to update on this table */ + if (diff_condition) { + ovsdb_condition_destroy(diff_condition); + ovsdb_condition_init(diff_condition); + } continue; } -- 2.31.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev