Hello,
thanks for reporting, I pushed a slightly different patch in master, 4.1
and 4.0 branches -- free is done even when ai->act is null.
Cheers,
Daniel
On 20/02/14 15:13, Surendra wrote:
Hi Daniel,
I am using async module to continue the transaction in
asynchronously. But I am observing a leak in shared memory. Then i checked
the code, we are not freeing the async_item_t after calling t_continue.
Same this has checked with MEMDBG=1.
Original code:
while(1) {
lock_get(&_async_list_head->ring[slot].lock);
ai = _async_list_head->ring[slot].lstart;
if(ai!=NULL)
_async_list_head->ring[slot].lstart = ai->next;
lock_release(&_async_list_head->ring[slot].lock);
if(ai==NULL)
break;
if(ai->act!=NULL)
tmb.t_continue(ai->tindex, ai->tlabel, ai->act);
}
Changed code:
while(1) {
lock_get(&_async_list_head->ring[slot].lock);
ai = _async_list_head->ring[slot].lstart;
if(ai!=NULL)
_async_list_head->ring[slot].lstart = ai->next;
lock_release(&_async_list_head->ring[slot].lock);
if(ai==NULL)
break;
if(ai->act!=NULL)
{
tmb.t_continue(ai->tindex, ai->tlabel, ai->act);
shm_free(ai); /* Added by surendra */
}
}
Please correct this if I am wrong.
Regards
@surendra
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda