Skip to content

Commit

Permalink
ovn-ic: Destroy the created index row for ts.
Browse files Browse the repository at this point in the history
Otherwise there would be a memory leak if
icnbrec_transit_switch_index_find() returns NULL.

Fixes: cf1b992("ovn-ic: fix potential segmentation violation when ts is deleted")
Signed-off-by: Numan Siddique <numans@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
numansiddique committed Nov 6, 2023
1 parent 325c7b2 commit f49306c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ic/ovn-ic.c
Expand Up @@ -1638,11 +1638,11 @@ collect_lr_routes(struct ic_context *ctx,
icnbrec_transit_switch_index_set_name(key, isb_pb->transit_switch);
t_sw = icnbrec_transit_switch_index_find(
ctx->icnbrec_transit_switch_by_name, key);
icnbrec_transit_switch_index_destroy_row(key);
if (!t_sw) {
continue;
}
ts_name = t_sw->name;
icnbrec_transit_switch_index_destroy_row(key);
routes_ad = shash_find_data(routes_ad_by_ts, ts_name);
if (!routes_ad) {
routes_ad = xzalloc(sizeof *routes_ad);
Expand Down

0 comments on commit f49306c

Please sign in to comment.