Module: kamailio
Branch: master
Commit: 6dd4b1f83cb041a42571ef1355832661be0ae492
URL:
https://github.com/kamailio/kamailio/commit/6dd4b1f83cb041a42571ef135583266…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2016-05-13T10:34:33+02:00
dispatcher: fix compiler warning #612
CC (gcc) [M dispatcher.so] dispatch.o
dispatch.c: In function 'ds_set_attrs':
dispatch.c:263:8: warning: 'tmp_rweight' may be used uninitialized in this
function [-Wmaybe-uninitialized]
int tmp_rweight;
^
make[3]: 'libkmi.so.1.0' is up to date.
---
Modified: modules/dispatcher/dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6dd4b1f83cb041a42571ef135583266…
Patch:
https://github.com/kamailio/kamailio/commit/6dd4b1f83cb041a42571ef135583266…
---
diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index a8061ec..d93b985 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -225,6 +225,7 @@ int ds_set_attrs(ds_dest_t *dest, str *attrs)
param_hooks_t phooks;
param_t *pit=NULL;
str param;
+ int tmp_rweight = 0;
if(attrs==NULL || attrs->len<=0)
return 0;
@@ -260,7 +261,7 @@ int ds_set_attrs(ds_dest_t *dest, str *attrs)
dest->attrs.socket = pit->body;
}else if(pit->name.len==7
&& strncasecmp(pit->name.s, "rweight", 7)==0) {
- int tmp_rweight;
+ tmp_rweight = 0;
str2sint(&pit->body, &tmp_rweight);
if ( tmp_rweight>=1 && tmp_rweight<=100 ) {
dest->attrs.rweight = tmp_rweight;