]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Release B channel allocation on error path in chan_misdn.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 30 Jul 2012 16:47:19 +0000 (16:47 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 30 Jul 2012 16:47:19 +0000 (16:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@370563 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c

index 7bcda32c42c8e0ca495813e2336604ba66701759..46dc6203d173085107bd85c27032e5a29fecdb6b 100644 (file)
@@ -7998,6 +7998,7 @@ static struct ast_channel *misdn_request(const char *type, format_t format, cons
        /* create ast_channel and link all the objects together */
        cl = chan_list_init(ORG_AST);
        if (!cl) {
+               misdn_lib_release(newbc);
                ast_log(LOG_ERROR, "Could not create call record for Dial(%s)\n", dial_str);
                return NULL;
        }
@@ -8006,6 +8007,7 @@ static struct ast_channel *misdn_request(const char *type, format_t format, cons
        ast = misdn_new(cl, AST_STATE_RESERVED, args.ext, NULL, format, requestor ? requestor->linkedid : NULL, port, channel);
        if (!ast) {
                chan_list_unref(cl, "Failed to create a new channel");
+               misdn_lib_release(newbc);
                ast_log(LOG_ERROR, "Could not create Asterisk channel for Dial(%s)\n", dial_str);
                return NULL;
        }