BUG/MEDIUM: pattern: fix memory leak in regex pattern functions

The allocated regex is not freed properly and can cause a memory leak,
eg. when patterns are updated via CLI socket.

This patch should be backported to all supported versions.
1 file changed