[sr-dev] dlg relase for dlg_set_timeout_by_profile()

Alex Balashov abalashov at evaristesys.com
Thu Jan 8 14:30:15 CET 2015


Daniel,

Sorry for the delay in responding to this; I'll look at it ASAP.

On 01/07/2015 03:58 PM, Daniel-Constantin Mierla wrote:

> Hello Alex,
>
> while analyzing the code of dialog module to allow setting the timeout
> even before the dialog is answered, I noticed that
> dlg_set_timeout_by_profile() is using update_dlg_timeout(), the later
> doing a dlg_release() inside it.
>
> However, dlg_set_timeout_by_profile() does another dlg_release() after
> update_dlg_timeout(), which seems wrong at first sight, resulting in two
> dereferences of the counter.
>
> Looking at git blame, dlg_release in both dlg_set_timeout_by_profile()
> and update_dlg_timeout() were added (or least last changed) by you.
>
> I would move the dlg_release() out of update_dlg_timeout(), because it
> is rather not intuitive to expect being done there, instead of where the
> dlg was referenced.
>
> Can you analyze and see if that is safe for your
> dlg_set_timeout_by_profile(), or another dlg_release() should be done
> inside it (as it gets removed from update_dlg_timeout() )?
>
> Cheers,
> Daniel
>


-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States

Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-dev mailing list