Module: kamailio
Branch: 5.1
Commit: fe6656c981d7a0f9efc745261d7dd13ff1f37fac
URL:
https://github.com/kamailio/kamailio/commit/fe6656c981d7a0f9efc745261d7dd13…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2018-02-28T16:40:26Z
kazoo: free envelope only on normal response
(cherry picked from commit 6c40983bf04a23bd7394c247980f21c5f2d6d817)
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/fe6656c981d7a0f9efc745261d7dd13…
Patch:
https://github.com/kamailio/kamailio/commit/fe6656c981d7a0f9efc745261d7dd13…
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index affaad4eda..3e161839dc 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -3127,7 +3127,6 @@ int kz_amqp_consumer_proc(kz_amqp_server_ptr server_ptr)
LM_DBG("CONSUMER INIT DONE\n");
while(OK) {
-// payload = NULL;
amqp_envelope_t envelope;
amqp_maybe_release_buffers(consumer->conn);
amqp_rpc_reply_t reply = amqp_consume_message(consumer->conn, &envelope, NULL,
0);
@@ -3165,6 +3164,7 @@ int kz_amqp_consumer_proc(kz_amqp_server_ptr server_ptr)
if(OK)
kz_amqp_send_worker_event(server_ptr, &envelope,
consumer_channels[idx].consumer);
}
+ amqp_destroy_envelope(&envelope);
break;
case AMQP_RESPONSE_SERVER_EXCEPTION:
LM_ERR("AMQP_RESPONSE_SERVER_EXCEPTION in consume\n");
@@ -3176,7 +3176,6 @@ int kz_amqp_consumer_proc(kz_amqp_server_ptr server_ptr)
OK = 0;
break;
};
- amqp_destroy_envelope(&envelope);
}
kz_amqp_connection_close(consumer);