1 /* Copyright (C) 2009 Trend Micro Inc.
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
16 /* Release all the memory created by the compilation/execution phases */
17 void OSPcre2_FreePattern(OSPcre2 *reg)
19 /* Free the match data */
20 if (reg->match_data) {
21 pcre2_match_data_free(reg->match_data);
22 reg->match_data = NULL;
27 pcre2_code_free(reg->regex);
31 /* Free the patter, */
37 /* Free the sub strings */
38 if (reg->sub_strings) {
39 OSPcre2_FreeSubStrings(reg);
40 free(reg->sub_strings);
41 reg->sub_strings = NULL;