瀏覽代碼

dispatcher: init socket pointer to null

- covers all situations, also when the afferent avp name is not set
Daniel-Constantin Mierla 10 年之前
父節點
當前提交
f93d3c70b1
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      modules/dispatcher/dispatch.c

+ 1 - 3
modules/dispatcher/dispatch.c

@@ -2055,7 +2055,7 @@ int ds_next_dst(struct sip_msg *msg, int mode)
 	struct search_state st;
 	struct usr_avp *avp;
 	struct usr_avp *prev_avp;
-	struct socket_info *sock;
+	struct socket_info *sock = NULL;
 	int_str avp_value;
 	int_str sock_avp_value;
 	int alg = 0;
@@ -2098,8 +2098,6 @@ int ds_next_dst(struct sip_msg *msg, int mode)
 			if (sscanf( sock_avp_value.s.s, "%p", (void**)&sock ) != 1)
 				sock = NULL;
 			destroy_avp(prev_avp);
-		} else {
-			sock = NULL;
 		}
 	}