X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=urlmatch.c;h=1e10c077440b95c31559835f96531e23c20c9afe;hb=7ac94170d9c4db1194cfceed2b92351dd5ed65a7;hp=fa0e15d085bc758faa57fe29bbf51b6c081bedac;hpb=49fee431b9f1e95ddca79f9874941dac1b52ab63;p=privoxy.git diff --git a/urlmatch.c b/urlmatch.c index fa0e15d0..1e10c077 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -105,7 +105,7 @@ void free_http_request(struct http_request *http) * Description : Splits the domain name so we can compare it * against wildcards. It used to be part of * parse_http_url, but was separated because the - * same code is required in chat in case of + * same code is required in chat() in case of * intercepted requests. * * Parameters : @@ -245,7 +245,7 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr /* - * Split URL into protocol,hostport,path. + * Split URL into protocol, hostport, path. */ { char *buf; @@ -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); - } }