[sr-dev] git:5.1:36b695bf: sipcapture: initialize variable

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 4 09:38:38 CEST 2018


Module: kamailio
Branch: 5.1
Commit: 36b695bf9fdd74eb1bdb11ac89d7f2c306f1294d
URL: https://github.com/kamailio/kamailio/commit/36b695bf9fdd74eb1bdb11ac89d7f2c306f1294d

Author: Mikko Lehto <mslehto at iki.fi>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-10-04T09:36:08+02:00

sipcapture: initialize variable

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

(cherry picked from commit a0db2cb021e45fe56f8b54121efa31bf071c8709)

---

Modified: src/modules/sipcapture/sipcapture.c

---

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

---

diff --git a/src/modules/sipcapture/sipcapture.c b/src/modules/sipcapture/sipcapture.c
index 6e6faa1ad4..33a14f887d 100644
--- a/src/modules/sipcapture/sipcapture.c
+++ b/src/modules/sipcapture/sipcapture.c
@@ -2489,7 +2489,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