Module: kamailio
Branch: 5.0
Commit: aa9db3e667b2a0029cc2dab4f74d226ae30f53c7
URL:
https://github.com/kamailio/kamailio/commit/aa9db3e667b2a0029cc2dab4f74d226…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2018-02-28T16:39:56Z
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/aa9db3e667b2a0029cc2dab4f74d226…
Patch:
https://github.com/kamailio/kamailio/commit/aa9db3e667b2a0029cc2dab4f74d226…
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index e04bdd3179..f0b73a0cc6 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -3115,7 +3115,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);
@@ -3153,6 +3152,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");
@@ -3164,7 +3164,6 @@ int kz_amqp_consumer_proc(kz_amqp_server_ptr server_ptr)
OK = 0;
break;
};
- amqp_destroy_envelope(&envelope);
}
kz_amqp_connection_close(consumer);