From d0e7e5a73ef1734693dd04c028d20734dfa802b4 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Mon, 10 Jun 2019 11:35:55 +0800 Subject: [PATCH] =?UTF-8?q?traffic=20mirror=E5=AF=B9=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E6=B3=95=E7=9A=84intercept=20policy=E5=88=A4=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/traffic-mirror/src/entry.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin/business/traffic-mirror/src/entry.cpp b/plugin/business/traffic-mirror/src/entry.cpp index 6943df5..85b46ed 100644 --- a/plugin/business/traffic-mirror/src/entry.cpp +++ b/plugin/business/traffic-mirror/src/entry.cpp @@ -25,8 +25,15 @@ void policy_table_ex_data_dup_cb(int table_id, MAAT_PLUGIN_EX_DATA * to, MAAT_PLUGIN_EX_DATA * from, long argl, void * argp) { struct policy_table_ex_data * ex_data = (struct policy_table_ex_data *)*from; - __sync_add_and_fetch(&ex_data->atomic_refcnt, 1); - *to = (void *)ex_data; + if(ex_data==NULL) + { + *to=NULL; + } + else + { + __sync_add_and_fetch(&ex_data->atomic_refcnt, 1); + *to = (void *)ex_data; + } } void policy_table_ex_data_free_cb(int table_id, MAAT_PLUGIN_EX_DATA * ad, long argl, void * argp)