From 4388948690718d26b88ee47f8181f03c046c7c5c Mon Sep 17 00:00:00 2001 From: liuxueli Date: Mon, 27 Sep 2021 11:26:43 +0800 Subject: [PATCH] =?UTF-8?q?TSG-7948:=20=E5=91=BD=E4=B8=AD=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E7=AD=96=E7=95=A5=E5=90=8E=E7=9B=91=E6=B5=8B=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=A4=B1=E6=95=88=E6=97=B6=E5=AF=BC=E8=87=B4=E5=86=85?= =?UTF-8?q?=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_rule.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 0515ca4..472d9bf 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -2516,12 +2516,19 @@ int tsg_get_vlan_id_by_monitor_rule(Maat_feather_t maat_feather, struct Maat_rul } user_region=tsg_get_compile_user_region(maat_feather, &(result[i])); - if(user_region!=NULL && user_region->method_type==TSG_METHOD_TYPE_MIRRORED && user_region->mirror!=NULL && user_region->mirror->enabled==1) + if(user_region==NULL) + { + continue; + } + + if(user_region->method_type==TSG_METHOD_TYPE_MIRRORED && user_region->mirror!=NULL && user_region->mirror->enabled==1) { count+=copy_vlan_id(vlan, count, user_region->mirror->vlan_id, &(result[i].config_id), 1); - tsg_free_compile_user_region(&(result[i]), user_region); - user_region=NULL; + } + + tsg_free_compile_user_region(&(result[i]), user_region); + user_region=NULL; } return count;