[sr-dev] [kamailio] dmq: fix memory leak (#59)

Daniel-Constantin Mierla notifications at github.com
Fri Jan 30 14:06:56 CET 2015


The headers parsed after cloning can be detected and cleaned up, the code should be like:

```
       for( hdr=req->headers ; hdr ; hdr=hdr->next ) {
               if ( hdr->parsed && hdr_allocs_parse(hdr) &&
               (hdr->parsed<(void*)t->uas.request ||
               hdr->parsed>=(void*)t->uas.end_request)) {
                       /* header parsed filed doesn't point inside uas.request 
                        * chunck -> it was added by resolving acc attributes ->
                       DBG("removing hdr->parsed %d\n", hdr->type);
                       clean_hdr_field(hdr);
                       hdr->parsed = 0;
               }
       }
```

Something similar is done in tm after running failure_route.

I think From is cloned if parsed before cloning.

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/59#issuecomment-72197919
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150130/9b511956/attachment.html>


More information about the sr-dev mailing list