[Asterisk-code-review] stasis_state: Make unsubscribes NULL tolerant (...asterisk[master])

Kevin Harwell asteriskteam at digium.com
Mon Jul 8 18:12:44 CDT 2019


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11539


Change subject: stasis_state: Make unsubscribes NULL tolerant
......................................................................

stasis_state: Make unsubscribes NULL tolerant

Regular stasis unsubscribes can handle NULL subscription objects. This patch
makes it so stasis state unsubscribes handles NULL's as well.

ASTERISK-28442

Change-Id: Ic3648e8df043a85b77cff085e9ff10356028e479
---
M main/stasis_state.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/39/11539/1

diff --git a/main/stasis_state.c b/main/stasis_state.c
index 2a9afcb..a915972 100644
--- a/main/stasis_state.c
+++ b/main/stasis_state.c
@@ -514,8 +514,11 @@
 
 void *stasis_state_unsubscribe_and_join(struct stasis_state_subscriber *sub)
 {
-	sub->stasis_sub = stasis_unsubscribe_and_join(sub->stasis_sub);
-	ao2_ref(sub, -1);
+	if (sub) {
+		sub->stasis_sub = stasis_unsubscribe_and_join(sub->stasis_sub);
+		ao2_ref(sub, -1);
+	}
+
 	return NULL;
 }
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11539
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ic3648e8df043a85b77cff085e9ff10356028e479
Gerrit-Change-Number: 11539
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190708/a8376e79/attachment.html>


More information about the asterisk-code-review mailing list