]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If there are no members in a queue, then the loop where the datastore for detecting
authorMark Michelson <mmichelson@digium.com>
Mon, 10 Dec 2007 16:29:44 +0000 (16:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 10 Dec 2007 16:29:44 +0000 (16:29 +0000)
duplicate dialed numbers will be skipped, meaning the datastore isn't created. This means
that when we try to free it, there's a crash. This stops that crash from occurring.

(closes issue #11499, reported by slavon, patched by eliel)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92202 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 34d03956259bf2a153853e3ff43153f805ffba28..d40237f75c1b83a310a50d85933fe6b1176d2cd4 100644 (file)
@@ -2663,8 +2663,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
        if (use_weight)
                AST_LIST_UNLOCK(&queues);
        lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
-       ast_channel_datastore_remove(qe->chan, datastore);
-       ast_channel_datastore_free(datastore);
+       if (datastore) {
+               ast_channel_datastore_remove(qe->chan, datastore);
+               ast_channel_datastore_free(datastore);
+       }
        ast_mutex_lock(&qe->parent->lock);
        if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
                store_next(qe, outgoing);