[sr-dev] git:master:c37e0032: siptrace: free trace_to_database_flag on module destroy

Daniel-Constantin Mierla miconda at gmail.com
Tue May 14 10:48:59 CEST 2019


Module: kamailio
Branch: master
Commit: c37e00326969c4be565a030708778a64714926e5
URL: https://github.com/kamailio/kamailio/commit/c37e00326969c4be565a030708778a64714926e5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-05-14T10:48:44+02:00

siptrace: free trace_to_database_flag on module destroy

---

Modified: src/modules/siptrace/siptrace.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c37e00326969c4be565a030708778a64714926e5.diff
Patch: https://github.com/kamailio/kamailio/commit/c37e00326969c4be565a030708778a64714926e5.patch

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 92e2019917..dfdbdcd409 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -495,13 +495,16 @@ static int child_init(int rank)
 
 static void destroy(void)
 {
-	if(trace_to_database_flag != NULL && *trace_to_database_flag != 0) {
-		if(db_con != NULL)
+	if(trace_to_database_flag != NULL) {
+		if(db_con != NULL) {
 			db_funcs.close(db_con);
+		}
+		shm_free(trace_to_database_flag);
 	}
 
-	if(trace_on_flag)
+	if(trace_on_flag) {
 		shm_free(trace_on_flag);
+	}
 }
 
 static inline str *siptrace_get_table(void)




More information about the sr-dev mailing list