diff options
| author | liuxueli <[email protected]> | 2021-09-27 11:26:43 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-09-27 11:26:43 +0800 |
| commit | 4388948690718d26b88ee47f8181f03c046c7c5c (patch) | |
| tree | cdb7ca35e5e09beb39b9caefb0cdc0745a1cb549 | |
| parent | 6f6774e7958db9c5023967aec5187f52ef49be6e (diff) | |
TSG-7948: 命中监测策略后监测配置失效时导致内存泄漏v5.4.2
| -rw-r--r-- | src/tsg_rule.cpp | 13 |
1 files 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;
|
