瀏覽代碼

mi_datagram: init structure before conditions to jump to err label

- garbage condition would have been made in err case
Daniel-Constantin Mierla 10 年之前
父節點
當前提交
bd189f4239
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/mi_datagram/datagram_fnc.c

+ 2 - 2
modules/mi_datagram/datagram_fnc.c

@@ -331,9 +331,9 @@ static void datagram_close_async(struct mi_root *mi_rpl,struct mi_handler *hdl,
 
 	LM_DBG("the socket domain is %i and af_local is %i\n", p->domain, AF_LOCAL);
 
-	mi_create_dtgram_replysocket(reply_sock, p->domain, err);
+	memset(&dtgram, 0, sizeof(dtgram));
 
-        memset(&dtgram, 0, sizeof(dtgram));
+	mi_create_dtgram_replysocket(reply_sock, p->domain, err);
 
 	if (mi_rpl!=0) {
 		/*allocate the response datagram*/