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

Richard Mudgett asteriskteam at digium.com
Mon Nov 23 14:46:57 CST 2015


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/1700

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/00/1700/1

diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c
index b2df298..8807c01 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/1700
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3b64453ea3058cb68d5c26d97d4fe7b8eea2e97
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list