[ 
https://issues.apache.org/jira/browse/TS-2396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Peach updated TS-2396:
----------------------------

    Description: 
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.


  was:
the codes as:
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 }

Can't  delete list_iter in the loop because the list_iter is the iterator for 
the loop.



> 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