[sr-dev] git:master: modules/avpops: Fix 'uninitialised variable' warning

Hugh Waite hugh.waite at crocodile-rcs.com
Fri Nov 22 10:55:06 CET 2013


Module: sip-router
Branch: master
Commit: 54020b00893ee259baee714d7d17adc6d31f9112
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=54020b00893ee259baee714d7d17adc6d31f9112

Author: Hugh Waite <hugh.waite at crocodile-rcs.com>
Committer: Hugh Waite <hugh.waite at crocodile-rcs.com>
Date:   Fri Nov 22 09:39:40 2013 +0000

modules/avpops: Fix 'uninitialised variable' warning

---

 modules/avpops/avpops_impl.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/avpops/avpops_impl.c b/modules/avpops/avpops_impl.c
index ee2e052..ecf31b0 100644
--- a/modules/avpops/avpops_impl.c
+++ b/modules/avpops/avpops_impl.c
@@ -1152,8 +1152,8 @@ int ops_check_avp( struct sip_msg* msg, struct fis_param* src,
 	struct search_state st1, st2;
 	unsigned short    name_type1;
 	unsigned short    name_type2;
-	struct usr_avp    *avp1;
-	struct usr_avp    *avp2;
+	struct usr_avp    *avp1 = NULL;
+	struct usr_avp    *avp2 = NULL;
 	regmatch_t        pmatch;
 	int_str           avp_name1;
 	int_str           avp_name2;
@@ -1253,7 +1253,6 @@ cycle1:
 		}
 		else if(val->u.sval->type==PVT_XAVP)
 		{
-			avp2 = 0;
 			if(xavp2==NULL)
 				if(get_xavp_param(msg, val->u.sval, &xavp2, &xavp2_flags)<0)
 					goto error;
@@ -1263,7 +1262,6 @@ cycle1:
 				goto next;
 			}
 		} else {
-			avp2 = 0;
 			if(pv_get_spec_value(msg, val->u.sval, &xvalue)!=0)
 			{
 				LM_ERR("cannot get dst value\n");
@@ -1286,7 +1284,6 @@ cycle1:
 			check_val.s = val->u.s;
 			check_flags = AVP_VAL_STR;
 		}
-		avp2 = 0;
 	}
 
 cycle2:




More information about the sr-dev mailing list