diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c index d734e9f57d5..8f3d3b20b19 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;