瀏覽代碼

tm: release re for t_check_status(pv)

- the canse when parameter is a variable and it contains a bad regex
Daniel-Constantin Mierla 11 年之前
父節點
當前提交
2f01858d0b
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/tm/tm.c

+ 2 - 0
modules/tm/tm.c

@@ -984,6 +984,8 @@ static int t_check_status(struct sip_msg* msg, char *p1, char *foo)
 		
 		if (regcomp(re, s, REG_EXTENDED|REG_ICASE|REG_NEWLINE)) {
 			ERR("Bad regular expression '%s'\n", s);
+			pkg_free(re);
+			re = NULL;
 			goto error;
 		}
 		break;