[Asterisk-code-review] translators: Don't use ast module running ref. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Jan 4 10:58:57 CST 2018


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7804


Change subject: translators: Don't use ast_module_running_ref.
......................................................................

translators: Don't use ast_module_running_ref.

Translators are run during module load before the module is actually
running, so it cannot use ast_module_running_ref.

ASTERISK-20346

Change-Id: Iaa0e75da99c696e38000f1a41e340abbd7a88f56
---
M main/translate.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/04/7804/1

diff --git a/main/translate.c b/main/translate.c
index 3d49057..9a1db10 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -342,7 +342,8 @@
 	 */
 	pvt->explicit_dst = ao2_bump(explicit_dst);
 
-	if (!ast_module_running_ref(t->module)) {
+	/* If the translator is in a module it must be running. */
+	if (t->module && !ast_module_running_ref(t->module)) {
 		ast_free(pvt);
 		return NULL;
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa0e75da99c696e38000f1a41e340abbd7a88f56
Gerrit-Change-Number: 7804
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180104/0cea3501/attachment.html>


More information about the asterisk-code-review mailing list