izmjene licence
[ossec-hids.git] / src / os_regex / os_regex_free_substrings.c
1 /* $OSSEC, os_regex_free_substrings.c, v0.1, 2006/01/02, Daniel B. Cid$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All right reserved.
5  *
6  * This program is a free software; you can redistribute it
7  * and/or modify it under the terms of the GNU General Public
8  * License (version 2) as published by the FSF - Free Software
9  * Foundation
10  */
11
12
13 #include <stdio.h>
14 #include <string.h>
15 #include <stdlib.h>
16
17 #include "os_regex.h"
18 #include "os_regex_internal.h"
19
20
21 /** int OSRegex_FreeSubStrings(OSRegex *reg) v0.1
22  * Release all the memory created to store the sub strings.
23  * Returns void.
24  */
25 void OSRegex_FreeSubStrings(OSRegex *reg)
26 {
27     /* Freeing the sub strings */
28     if(reg->sub_strings)
29     {
30         int i = 0;
31         while(reg->sub_strings[i])
32         {
33             free(reg->sub_strings[i]);
34             reg->sub_strings[i] = NULL;
35             i++;
36         }
37     }
38     return;
39 }
40
41
42 /* EOF */