Browse Source

- call regfree to free regexps compiled on the fly

Jan Janak 18 năm trước cách đây
mục cha
commit
0f0ae45dcb
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 8 2
      modules/tm/tm.c

+ 8 - 2
modules/tm/tm.c

@@ -735,14 +735,20 @@ static int t_check_status(struct sip_msg* msg, char *p1, char *foo)
 
 
 	if (backup) status[msg->first_line.u.reply.status.len] = backup;
 	if (backup) status[msg->first_line.u.reply.status.len] = backup;
 	if (s) pkg_free(s);
 	if (s) pkg_free(s);
-	if ((fp->type != FPARAM_REGEX) && re) pkg_free(re);
+	if ((fp->type != FPARAM_REGEX) && re) {
+		regfree(re);
+		pkg_free(re);
+	}
 
 
 	if (n!=0) return -1;
 	if (n!=0) return -1;
 	return 1;
 	return 1;
 
 
  error:
  error:
 	if (s) pkg_free(s);
 	if (s) pkg_free(s);
-	if ((fp->type != FPARAM_REGEX) && re) pkg_free(re);
+	if ((fp->type != FPARAM_REGEX) && re) {
+		regfree(re);
+		pkg_free(re);
+	}
 	return -1;
 	return -1;
 }
 }