dodan override za lintian
[ossec-hids.git] / src / os_regex / os_regex_free_pattern.c
index 2cfa00e..5dfee68 100755 (executable)
@@ -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;
     }