#include <regex.h>
#define UTILS_MATCH_FLAGS_EXCLUDE_REGEX 0x02
+#define UTILS_MATCH_FLAGS_REGEX 0x04
struct cu_match_s {
regex_t regex;
sfree(obj);
return (NULL);
}
+ obj->flags |= UTILS_MATCH_FLAGS_REGEX;
if (excluderegex && strcmp(excluderegex, "") != 0) {
status = regcomp(&obj->excluderegex, excluderegex, REG_EXTENDED);
if (obj == NULL)
return;
+ if (obj->flags & UTILS_MATCH_FLAGS_REGEX)
+ regfree(&obj->regex);
+ if (obj->flags & UTILS_MATCH_FLAGS_EXCLUDE_REGEX)
+ regfree(&obj->excluderegex);
if ((obj->user_data != NULL) && (obj->free != NULL))
(*obj->free)(obj->user_data);