new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_regex / os_pcre2_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 <stdlib.h>
12 #include <string.h>
13
14 #include "os_regex.h"
15
16 /* Release all the memory created to store the sub strings */
17 void OSPcre2_FreeSubStrings(OSPcre2 *reg) {
18     int i = 0;
19
20     /* Free the sub strings */
21     if (reg->sub_strings) {
22         while (reg->sub_strings[i]) {
23             free(reg->sub_strings[i]);
24             reg->sub_strings[i] = NULL;
25             i++;
26         }
27     }
28     return;
29 }
30