]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7552 #resolve
authorWilliam King <william.king@quentustech.com>
Wed, 13 May 2015 22:56:18 +0000 (15:56 -0700)
committerWilliam King <william.king@quentustech.com>
Wed, 13 May 2015 22:56:18 +0000 (15:56 -0700)
src/mod/event_handlers/mod_amqp/mod_amqp.c
src/mod/event_handlers/mod_amqp/mod_amqp_producer.c

index dfb32f0a283e449bf5e6e4c3d911726b3bd8f0eb..a4810649750d83cfec0c90f529c5e77f75a429bf 100644 (file)
@@ -88,12 +88,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_amqp_shutdown)
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mod starting shutting down\n");
        switch_event_unbind_callback(mod_amqp_producer_event_handler);
 
-       for (hi = switch_core_hash_first(globals.producer_hash); hi; hi = switch_core_hash_next(&hi)) {
+       while ((hi = switch_core_hash_first(globals.producer_hash))) {
                switch_core_hash_this(hi, NULL, NULL, (void **)&producer);
                mod_amqp_producer_destroy(&producer);
        }
 
-       for (hi = switch_core_hash_first(globals.command_hash); hi; hi = switch_core_hash_next(&hi)) {
+       while ((hi = switch_core_hash_first(globals.command_hash))) {
                switch_core_hash_this(hi, NULL, NULL, (void **)&command);
                mod_amqp_command_destroy(&command);
        }
index 1bb344f2703422252ea8e108c11976454a9aaeb6..dd649495d71f14f21ead2f155a771c8f183a91c8 100644 (file)
@@ -311,6 +311,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg)
 
        if ( mod_amqp_connection_open(profile->conn_root, &(profile->conn_active), profile->name, profile->custom_attr) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] was unable to connect to any connection\n", profile->name);
+               goto err;
        }
 
        amqp_exchange_declare(profile->conn_active->state, 1,