From 899ae69a4b3a33e4e295b28966ea7e570d087cf2 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Thu, 15 Oct 2020 14:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E6=8B=A6=E6=88=AA=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD=E5=AF=BC=E8=87=B4=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F=EF=BC=9Bdictator=5Fmalloc=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_entry.cpp | 10 ++++++++-- src/tsg_rule.cpp | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 63e3bfb..0a3c1e0 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -441,6 +441,12 @@ static struct Maat_rule_t *tsg_policy_decision_criteria(struct streaminfo *a_str &mid, thread_seq); + if(mid!=NULL) + { + Maat_clean_status(&mid); + mid=NULL; + } + if(ret>0) { MESA_handle_runtime_log(g_tsg_para.logger, @@ -667,7 +673,7 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t case OP_STATE_PENDING: FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_TCP_LINKS], 0, FS_OP_ADD, 1); - internal_label=(struct _session_attribute_label_t *)dictator_malloc(1, sizeof(struct _session_attribute_label_t)); + internal_label=(struct _session_attribute_label_t *)dictator_malloc(thread_seq, sizeof(struct _session_attribute_label_t)); memset(internal_label, 0, sizeof(struct _session_attribute_label_t)); memset(&identify_info, 0, sizeof(identify_info)); @@ -927,7 +933,7 @@ extern "C" char TSG_MASTER_UDP_ENTRY(struct streaminfo *a_udp, void **pme, int t memset(&identify_info, 0, sizeof(identify_info)); identify_application_protocol(a_udp, &identify_info, NULL, a_packet); - internal_label=(struct _session_attribute_label_t *)dictator_malloc(1, sizeof(struct _session_attribute_label_t)); + internal_label=(struct _session_attribute_label_t *)dictator_malloc(thread_seq, sizeof(struct _session_attribute_label_t)); memset(internal_label, 0, sizeof(struct _session_attribute_label_t)); internal_label->proto=identify_info.proto; diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 3acaa63..5362761 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -147,11 +147,17 @@ static int get_data_center(char *accept_tag, char *data_center, int data_center_ len=strlen(v_item->valuestring); memcpy(data_center, v_item->valuestring, (len>data_center_len-1 ? data_center_len-1 : len)); } + + cJSON_Delete(object); + object=NULL; return 1; } } } } + + cJSON_Delete(object); + object=NULL; } return 0;