]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_stasis_device_state: Fix refcounting error. 95/2195/1
authorMark Michelson <mmichelson@digium.com>
Thu, 4 Feb 2016 17:39:10 +0000 (11:39 -0600)
committerMark Michelson <mmichelson@digium.com>
Thu, 4 Feb 2016 17:39:10 +0000 (11:39 -0600)
commit23829b325377ae32f78cef81a48cc4318a7206b9
treec475b0fc60b18ed5fdb87884baa24b65a7a2342a
parentf55f79edbaa9066f2ffb36c9a7c2433357698615
res_stasis_device_state: Fix refcounting error.

Device state subscription lifetimes were governed by when the
subscription was established and unsubscribed from. However, it is
possible that at the time of unsubscription, there could be device state
events still in flight. When those device state events occur, the device
state callback could attempt to dereference a freed pointer. Crash.

This change ensures that the lifetime of the device state subscription
does not end until the underlying stasis subscription has confirmed that
its final message has been sent.

Change-Id: I25a0f1472894c1a562252fb7129671478e25e9b2
res/res_stasis_device_state.c