[ 
https://issues.apache.org/jira/browse/TS-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832799#comment-13832799
 ] 

James Peach commented on TS-2396:
---------------------------------

Merged. A helpful extra fix would be to add a destructor to RegexMapping().

> UrlRewrite.cc free the node of queue not correctly
> --------------------------------------------------
>
>                 Key: TS-2396
>                 URL: https://issues.apache.org/jira/browse/TS-2396
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP
>            Reporter: Yu Qing
>            Assignee: Yu Qing
>         Attachments: 
> 0001-TS-2396-UrlRewrite.cc-free-the-node-of-queue-not-cor.patch
>
>
> the codes as:
> {code}
> 960 void
> 961 UrlRewrite::_destroyList(RegexMappingList &mappings)
> 962 {
> 963   forl_LL(RegexMapping, list_iter, mappings) {
> 964     delete list_iter->url_map;
> 965     if (list_iter->re) {
> 966       pcre_free(list_iter->re);
> 967     }
> 968     if (list_iter->re_extra) {
> 969       pcre_free(list_iter->re_extra);
> 970     }
> 971     if (list_iter->to_url_host_template) {
> 972       ats_free(list_iter->to_url_host_template);
> 973     }
> 974     delete list_iter;
> 975   }
> 976   mappings.clear();
> 977 }
> {code}
> Can't  delete list_iter in the loop because the list_iter is the iterator for 
> the loop.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to