X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=urlmatch.c;h=750cd242a1da3ae45d329d49d7ea7bd7e3490aad;hp=4670f310aea5c4e2fd3b7d1addf879ed56c0f766;hb=b15aee14f3dc660a966acb7c3f542586a768a1a0;hpb=5c0e4a1f6c77d47c8514f9c70c2b36748d0e598a diff --git a/urlmatch.c b/urlmatch.c index 4670f310..750cd242 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1206,9 +1206,9 @@ jb_err create_pattern_spec(struct pattern_spec *pattern, char *buf) const unsigned flag; } tag_pattern[] = { { "TAG:", 4, PATTERN_SPEC_TAG_PATTERN}, - #ifdef FEATURE_CLIENT_TAGS +#ifdef FEATURE_CLIENT_TAGS { "CLIENT-TAG:", 11, PATTERN_SPEC_CLIENT_TAG_PATTERN}, - #endif +#endif { "NO-REQUEST-TAG:", 15, PATTERN_SPEC_NO_REQUEST_TAG_PATTERN}, { "NO-RESPONSE-TAG:", 16, PATTERN_SPEC_NO_RESPONSE_TAG_PATTERN} }; @@ -1263,6 +1263,17 @@ void free_pattern_spec(struct pattern_spec *pattern) if (pattern == NULL) return; freez(pattern->spec); + + if (!(pattern->flags & PATTERN_SPEC_URL_PATTERN)) + { + if (pattern->pattern.tag_regex) + { + regfree(pattern->pattern.tag_regex); + freez(pattern->pattern.tag_regex); + } + return; + } + #ifdef FEATURE_PCRE_HOST_PATTERNS if (pattern->pattern.url_spec.host_regex) { @@ -1279,11 +1290,6 @@ void free_pattern_spec(struct pattern_spec *pattern) regfree(pattern->pattern.url_spec.preg); freez(pattern->pattern.url_spec.preg); } - if (pattern->pattern.tag_regex) - { - regfree(pattern->pattern.tag_regex); - freez(pattern->pattern.tag_regex); - } }