Ver Fonte

tm: release re for t_check_status(pv)

- the canse when parameter is a variable and it contains a bad regex
Daniel-Constantin Mierla há 11 anos atrás
pai
commit
2f01858d0b
1 ficheiros alterados com 2 adições e 0 exclusões
  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;