]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
translators: Don't use ast_module_running_ref.
authorCorey Farrell <git@cfware.com>
Thu, 4 Jan 2018 16:50:13 +0000 (11:50 -0500)
committerCorey Farrell <git@cfware.com>
Thu, 4 Jan 2018 17:01:56 +0000 (12:01 -0500)
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

main/translate.c

index 3d4905723c905efcc7582c7ae2b036dc0fc2df24..02717c5ed1ed6da989645146224bc9c937654efd 100644 (file)
@@ -342,10 +342,7 @@ static struct ast_trans_pvt *newpvt(struct ast_translator *t, struct ast_format
         */
        pvt->explicit_dst = ao2_bump(explicit_dst);
 
-       if (!ast_module_running_ref(t->module)) {
-               ast_free(pvt);
-               return NULL;
-       }
+       ast_module_ref(t->module);
 
        /* call local init routine, if present */
        if (t->newpvt && t->newpvt(pvt)) {