[sr-dev] git:master:a0db2cb0: sipcapture: initialize variable

Mikko Lehto mslehto at iki.fi
Wed Oct 3 09:16:20 CEST 2018


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

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Mikko Lehto <mslehto at iki.fi>
Date: 2018-10-02T16:14:48+03:00

sipcapture: initialize variable

> sipcapture.c:2580:5: warning: variable 'corrtmp' is used uninitialized whenever 'if' condition is false
>       [-Wsometimes-uninitialized]
>         if(correlation_id) {
>            ^~~~~~~~~~~~~~

---

Modified: src/modules/sipcapture/sipcapture.c

---

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

---

diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index bb3332b26f..327e4e110f 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -2499,7 +2499,8 @@ int receive_logging_json_msg(char *buf, unsigned int len,
 	struct timezone tz;
 	time_t epoch_time_as_time_t;
 
-	str tmp, corrtmp, table;
+	str tmp, table;
+	str corrtmp = STR_NULL;
 	_capture_mode_data_t *c = NULL;
 
 	c = capture_def;




More information about the sr-dev mailing list