[Asterisk-code-review] res sorcery realtime.c: Fix crash from NULL sorcery object t... (asterisk[certified/13.1])

Mark Michelson asteriskteam at digium.com
Mon Nov 23 18:04:57 CST 2015


Mark Michelson has submitted this change and it was merged.

Change subject: res_sorcery_realtime.c: Fix crash from NULL sorcery object type.
......................................................................


res_sorcery_realtime.c: Fix crash from NULL sorcery object type.

If the sorcery object type is not found a NULL is returned.
Unfortunately, sorcery_realtime_filter_objectset() will crash after
complaining about not finding the object type and saying to expect errors.

* Use ao2_cleanup() instead of ao2_ref() to prevent the crash.

ASTERISK-25165
Reported by Corey Farrell

Change-Id: Ic3b64453ea3058cb68d5c26d97d4fe7b8eea2e97
---
M res/res_sorcery_realtime.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Corey Farrell: Looks good to me, but someone else must approve



diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index 61a97c6..9724fb2 100644
--- a/res/res_sorcery_realtime.c
+++ b/res/res_sorcery_realtime.c
@@ -142,7 +142,7 @@
 		}
 	}
 
-	ao2_ref(object_type, -1);
+	ao2_cleanup(object_type);
 
 	return objectset;
 }

-- 
To view, visit https://gerrit.asterisk.org/1701
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3b64453ea3058cb68d5c26d97d4fe7b8eea2e97
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list