new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_regex / os_regex_free_substrings.c
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All right reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation
8  */
9
10 #include <stdio.h>
11 #include <string.h>
12 #include <stdlib.h>
13
14 #include "os_regex.h"
15 #include "os_regex_internal.h"
16
17
18 /* Release all the memory created to store the sub strings */
19 void OSRegex_FreeSubStrings(OSRegex *reg)
20 {
21     /* Free the sub strings */
22     if (reg->sub_strings) {
23         int i = 0;
24         while (reg->sub_strings[i]) {
25             free(reg->sub_strings[i]);
26             reg->sub_strings[i] = NULL;
27             i++;
28         }
29     }
30     return;
31 }
32