X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=src%2Fos_regex%2Fos_pcre2_free_substrings.c;fp=src%2Fos_regex%2Fos_pcre2_free_substrings.c;h=4e2eeacb8b728088add2097693a5de822f3a5401;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=0000000000000000000000000000000000000000;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b;p=ossec-hids.git diff --git a/src/os_regex/os_pcre2_free_substrings.c b/src/os_regex/os_pcre2_free_substrings.c new file mode 100644 index 0000000..4e2eeac --- /dev/null +++ b/src/os_regex/os_pcre2_free_substrings.c @@ -0,0 +1,30 @@ +/* Copyright (C) 2009 Trend Micro Inc. + * All right reserved. + * + * This program is a free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public + * License (version 2) as published by the FSF - Free Software + * Foundation + */ + +#include +#include +#include + +#include "os_regex.h" + +/* Release all the memory created to store the sub strings */ +void OSPcre2_FreeSubStrings(OSPcre2 *reg) { + int i = 0; + + /* Free the sub strings */ + if (reg->sub_strings) { + while (reg->sub_strings[i]) { + free(reg->sub_strings[i]); + reg->sub_strings[i] = NULL; + i++; + } + } + return; +} +