From f49306c6d90bc6f6553cd395335fae716294de48 Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Fri, 3 Nov 2023 11:58:53 -0400 Subject: [PATCH] ovn-ic: Destroy the created index row for ts. Otherwise there would be a memory leak if icnbrec_transit_switch_index_find() returns NULL. Fixes: cf1b9920c48e("ovn-ic: fix potential segmentation violation when ts is deleted") Signed-off-by: Numan Siddique Acked-by: Mark Michelson Signed-off-by: Numan Siddique --- ic/ovn-ic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index 020b1d60b5..8ceb34d7cc 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -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);