瀏覽代碼

- t_check_status() fix: in some error case a noninit pointer could be used
(patch from Bogdan Pintea <[email protected]>, part of SER-346)

Andrei Pelinescu-Onciul 17 年之前
父節點
當前提交
b9296ed376
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/tm/tm.c

+ 2 - 2
modules/tm/tm.c

@@ -687,6 +687,8 @@ static int t_check_status(struct sip_msg* msg, char *p1, char *foo)
 	regex_t* re = NULL;
 	str tmp;
 	
+	fp = (fparam_t*)p1;
+	
 	/* first get the transaction */
 	if (t_check(msg, 0 ) == -1) return -1;
 	if ((t = get_t()) == 0) {
@@ -696,8 +698,6 @@ static int t_check_status(struct sip_msg* msg, char *p1, char *foo)
 	}
 	backup = 0;
 	
-	fp = (fparam_t*)p1;
-	
 	switch(fp->type) {
 	case FPARAM_REGEX:
 		re = fp->v.regex;