Skip to content
Snippets Groups Projects
  • Mike Bradeen's avatar
    ac8988c9
    sched: fix and test a double deref on delete of an executing call back · ac8988c9
    Mike Bradeen authored
    sched: Avoid a double deref when AST_SCHED_DEL_UNREF is called on an
    executing call-back. This is done by adding a new variable 'rescheduled'
    to the struct sched which is set in ast_sched_runq and checked in
    ast_sched_del_nonrunning. ast_sched_del_nonrunning is a replacement for
    now deprecated ast_sched_del which returns a new possible value -2
    if called on an executing call-back with rescheduled set. ast_sched_del
    is modified to call ast_sched_del_nonrunning to maintain existing code.
    AST_SCHED_DEL_UNREF is also updated to look for the -2 in which case it
    will not throw a warning or invoke refcall.
    test_sched: Add a new unit test sched_test_freebird that will check the
    reference count in the resolved scenario.
    
    ASTERISK-29698
    
    Change-Id: Icfb16b3acbc29cf5b4cef74183f7531caaefe21d
    ac8988c9
    History
    sched: fix and test a double deref on delete of an executing call back
    Mike Bradeen authored
    sched: Avoid a double deref when AST_SCHED_DEL_UNREF is called on an
    executing call-back. This is done by adding a new variable 'rescheduled'
    to the struct sched which is set in ast_sched_runq and checked in
    ast_sched_del_nonrunning. ast_sched_del_nonrunning is a replacement for
    now deprecated ast_sched_del which returns a new possible value -2
    if called on an executing call-back with rescheduled set. ast_sched_del
    is modified to call ast_sched_del_nonrunning to maintain existing code.
    AST_SCHED_DEL_UNREF is also updated to look for the -2 in which case it
    will not throw a warning or invoke refcall.
    test_sched: Add a new unit test sched_test_freebird that will check the
    reference count in the resolved scenario.
    
    ASTERISK-29698
    
    Change-Id: Icfb16b3acbc29cf5b4cef74183f7531caaefe21d