Fixed crashes from issue8824 review board channel locking changes.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 5 May 2009 20:54:07 +0000 (20:54 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 5 May 2009 20:54:07 +0000 (20:54 +0000)
The local struct ast_party_connected_line connected_caller variable
was uninitialized when the copy function was called.

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

apps/app_dial.c
apps/app_directed_pickup.c
apps/app_queue.c
channels/chan_sip.c
main/features.c

index 44c1228..77d8a86 100644 (file)
@@ -864,6 +864,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
 #endif
        struct ast_party_connected_line connected_caller;
        struct ast_str *featurecode = ast_str_alloca(FEATURE_MAX_LEN + 1);
+
+       ast_party_connected_line_init(&connected_caller);
        if (single) {
                /* Turn off hold music, etc */
                if (!ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK))
index 0cf691c..283846e 100644 (file)
@@ -97,6 +97,7 @@ static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
        ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
 
        connected_caller = target->connected;
+       ast_party_connected_line_init(&target->connected);
        connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
        ast_channel_update_connected_line(chan, &connected_caller);
 
@@ -105,7 +106,6 @@ static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
        ast_channel_unlock(chan);
        connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
        ast_channel_queue_connected_line_update(chan, &connected_caller);
-       ast_party_connected_line_init(&target->connected);
        ast_party_connected_line_free(&connected_caller);
 
        if ((res = ast_answer(chan))) {
index 1c9d0b7..eee4e55 100644 (file)
@@ -2846,6 +2846,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
        struct ast_party_connected_line connected_caller;
        char *inchan_name;
 
+       ast_party_connected_line_init(&connected_caller);
+
        ast_channel_lock(qe->chan);
        inchan_name = ast_strdupa(qe->chan->name);
        ast_channel_unlock(qe->chan);
index 81111cb..5412daa 100644 (file)
@@ -20104,6 +20104,7 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
                        ast_channel_unlock(targetcall_pvt->owner);
                }
 
+               ast_party_connected_line_init(&connected_caller);
                if (target.chan2) {
                        if (current->chan2) {
                                /* Tell each of the other channels to whom they are now connected */
index 032e3ec..7944d4c 100644 (file)
@@ -1389,7 +1389,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
        struct ast_bridge_config bconfig;
        struct ast_frame *f;
        int l;
-       struct ast_party_connected_line connected_line = {{0,},};
+       struct ast_party_connected_line connected_line;
        struct ast_datastore *features_datastore;
        struct ast_dial_features *dialfeatures = NULL;
 
@@ -1459,6 +1459,7 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
        newchan = feature_request_and_dial(transferer, transferee, "Local", ast_best_codec(transferer->nativeformats),
                xferto, atxfernoanswertimeout, &outstate, transferer->cid.cid_num, transferer->cid.cid_name, 1, transferer->language);
 
+       ast_party_connected_line_init(&connected_line);
        if (!ast_check_hangup(transferer)) {
                /* Transferer is up - old behaviour */
                ast_indicate(transferer, -1);