X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fos_regex%2Fos_regex_free_pattern.c;h=5dfee68eb6c13ffa63e4082c107ffbb7b2db2241;hb=927951d1c1ad45ba9e7325f07d996154a91c911b;hp=2cfa00e034566f0bd318697634e43fe79c723d29;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/os_regex/os_regex_free_pattern.c b/src/os_regex/os_regex_free_pattern.c index 2cfa00e..5dfee68 100755 --- a/src/os_regex/os_regex_free_pattern.c +++ b/src/os_regex/os_regex_free_pattern.c @@ -5,7 +5,7 @@ * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * License (version 2) as published by the FSF - Free Software * Foundation */ @@ -35,16 +35,17 @@ void OSRegex_FreePattern(OSRegex *reg) { if(*pattern) free(*pattern); - pattern++; + pattern++; } free(reg->patterns); - free(reg->flags); - reg->patterns = NULL; - reg->flags = NULL; } + /* Freeing the flags */ + free(reg->flags); + reg->flags = NULL; + /* Freeing the closure */ if(reg->prts_closure) { @@ -74,7 +75,7 @@ void OSRegex_FreePattern(OSRegex *reg) /* Freeing the sub strings */ if(reg->sub_strings) { - OSRegex_FreeSubStrings(reg); + OSRegex_FreeSubStrings(reg); free(reg->sub_strings); reg->sub_strings = NULL; }