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

2015-02-02 Thread Andrey Rybkin
Hmm, maybe it will be correctly? void worker_loop(int id) { dmq_worker_t* worker; dmq_job_t* current_job; peer_reponse_t peer_response; int ret_value; int not_parsed; dmq_node_t *dmq_node = NULL; worker = &workers[id]; for(;;) {

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

2015-02-02 Thread Daniel-Constantin Mierla
Are you sure it is the right fix? Is there no possibility that someone else is parsing the From header before clonning (e.g., from config file)? --- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/59#issuecomment-72432180___

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

2015-02-01 Thread Andrey Rybkin
Merged #59. --- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/59#event-228303023___ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

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

2015-01-30 Thread Charles Chance
Having investigated further, the code which calls parse_from_header() is new - introduced for the purpose of letting the callback function know about the sending node - and I had wrongly assumed we were already parsing the From header prior to cloning. So apologies - I would say this is OK to me

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

2015-01-30 Thread Charles Chance
Thanks for clarifying, Daniel. As the From header is parsed prior to cloning (and therefore included in the clone), it is pointless to parse it again and have to manually clean it up later - so this part of the code needs changing anyway. I have added a commit to master relating to the above -

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

2015-01-30 Thread Daniel-Constantin Mierla
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*)

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

2015-01-30 Thread Charles Chance
The problem may be earlier in worker_loop(): 95 if (parse_from_header(current_job->msg) < 0) { 96 LM_ERR("bad sip message or missing From hdr\n"); 97 } else { 98

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

2015-01-30 Thread Andrey Rybkin
Yes, i observed leak in dmq_worker process: fm_status: count= 3648 size= 1887776 bytes from : parser/parse_from.c: parse_from_header(63) fm_status: count= 3648 size=418016 bytes from : parser/parse_addr_spec.c: parse_to_param(281) --- Reply to this email directly or view it on GitHub:

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

2015-01-30 Thread Charles Chance
Have you observed a leak here? According to the documentation for sip_msg_shm_clone() [1]: "org_msg is cloned along with most of its headers and lumps into one shm memory block (so that a shm_free() on the result will free everything)." 1. http://rpm.kamailio.org/doxygen/sip-router/branch/mast

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

2015-01-29 Thread Andrey Rybkin
You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/59 -- Commit Summary -- * dmq: fix memory leak -- File Changes -- M modules/dmq/worker.c (4) -- Patch Links -- https://github.com/kamailio/kamailio/pull/59.patch https://github.