Skip to content

Commit c09937c

Browse files
committed
siptrace: add referencing for dynamic tids
1 parent 7639f63 commit c09937c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

modules/siptrace/siptrace.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ static int parse_trace_id(unsigned int type, void *val);
184184

185185
void free_trace_info_pkg(void *param);
186186
void free_trace_info_shm(void *param);
187+
static void free_trace_filters(struct trace_filter *list);
187188

188189

189190
static int init_dyn_tracing(void);
@@ -1111,12 +1112,18 @@ static void trace_transaction_dlgcb(struct dlg_cell* dlg, int type,
11111112

11121113
void free_trace_info_pkg(void *param)
11131114
{
1114-
pkg_free((trace_info_p)param);
1115+
trace_info_p info = (trace_info_p)param;
1116+
if (info->trace_list->dynamic)
1117+
trace_id_unref(info->trace_list);
1118+
pkg_free(param);
11151119
}
11161120

11171121
void free_trace_info_shm(void *param)
11181122
{
1119-
shm_free((trace_info_p)param);
1123+
trace_info_p info = (trace_info_p)param;
1124+
if (info->trace_list->dynamic)
1125+
trace_id_unref(info->trace_list);
1126+
shm_free(param);
11201127
}
11211128

11221129
static int trace_transaction(struct sip_msg* msg, trace_info_p info,
@@ -3213,7 +3220,8 @@ static int process_dyn_tracing(struct sip_msg *msg, void *param)
32133220
break;
32143221
}
32153222
}
3216-
sip_trace_handle(msg, it, el->scope, el->type, NULL);
3223+
if (sip_trace_handle(msg, it, el->scope, el->type, NULL) == 1)
3224+
trace_id_ref(el);
32173225
skip:
32183226
continue;
32193227
}

0 commit comments

Comments
 (0)