Merge "res_sorcery_realtime: Fix leak of sorcery object type."
authorJoshua Colp <jcolp@digium.com>
Tue, 30 Jun 2015 12:32:22 +0000 (07:32 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Tue, 30 Jun 2015 12:32:23 +0000 (07:32 -0500)
main/channel.c
res/res_corosync.c
res/res_pjsip_nat.c

index fbdf17b..935ac28 100644 (file)
@@ -3905,11 +3905,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                switch (f->frametype) {
                case AST_FRAME_CONTROL:
                        if (f->subclass.integer == AST_CONTROL_ANSWER) {
-                               if (!ast_test_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING)) {
-                                       ast_debug(1, "Ignoring answer on an inbound call!\n");
-                                       ast_frfree(f);
-                                       f = &ast_null_frame;
-                               } else if (prestate == AST_STATE_UP && ast_channel_is_bridged(chan)) {
+                               if (prestate == AST_STATE_UP && ast_channel_is_bridged(chan)) {
                                        ast_debug(1, "Dropping duplicate answer!\n");
                                        ast_frfree(f);
                                        f = &ast_null_frame;
index 0b3a61f..6642acd 100644 (file)
@@ -863,7 +863,6 @@ static void cleanup_module(void)
 static int load_module(void)
 {
        cs_error_t cs_err;
-       enum ast_module_load_result res = AST_MODULE_LOAD_FAILURE;
        struct cpg_name name;
 
        corosync_aggregate_topic = stasis_topic_create("corosync_aggregate_topic");
@@ -885,7 +884,6 @@ static int load_module(void)
 
        if (load_config(0)) {
                /* simply not configured is not a fatal error */
-               res = AST_MODULE_LOAD_DECLINE;
                goto failed;
        }
 
@@ -926,7 +924,7 @@ static int load_module(void)
 failed:
        cleanup_module();
 
-       return res;
+       return AST_MODULE_LOAD_DECLINE;
 }
 
 static int unload_module(void)
index fadefd8..483caa2 100644 (file)
@@ -63,7 +63,7 @@ static int rewrite_route_set(pjsip_rx_data *rdata, pjsip_dialog *dlg)
        if (rr) {
                uri = pjsip_uri_get_uri(&rr->name_addr);
                rewrite_uri(rdata, uri);
-               if (dlg && dlg->route_set.next && !dlg->route_set_frozen) {
+               if (dlg && !pj_list_empty(&dlg->route_set) && !dlg->route_set_frozen) {
                        pjsip_routing_hdr *route = dlg->route_set.next;
                        uri = pjsip_uri_get_uri(&route->name_addr);
                        rewrite_uri(rdata, uri);
@@ -85,7 +85,7 @@ static int rewrite_contact(pjsip_rx_data *rdata, pjsip_dialog *dlg)
 
                rewrite_uri(rdata, uri);
 
-               if (dlg && !dlg->route_set_frozen && (!dlg->remote.contact
+               if (dlg && pj_list_empty(&dlg->route_set) && (!dlg->remote.contact
                        || pjsip_uri_cmp(PJSIP_URI_IN_REQ_URI, dlg->remote.contact->uri, contact->uri))) {
                        dlg->remote.contact = (pjsip_contact_hdr*)pjsip_hdr_clone(dlg->pool, contact);
                        dlg->target = dlg->remote.contact->uri;