summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2013-05-25 00:19:12 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2013-05-25 00:19:12 -0700
commit0f1f75b5f38201a9cec6381fc2a3a8cd8c698414 (patch)
tree465254d3831aff4f3a877cc461b85b13d86f2184
parent872ea49b62ae4e742f6639c93a498be4b7833c92 (diff)
downloadrabbitmq-c-github-ask-0f1f75b5f38201a9cec6381fc2a3a8cd8c698414.tar.gz
FIX: memory leak in amqp_new_connection
amqp_new_connection will fail to free the amqp_connection_state_t object that is allocated when amqp_tune_connection fails with ERROR_NO_MEMORY. This fixes that
-rw-r--r--librabbitmq/amqp_connection.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c
index 2d50ad3..962cc42 100644
--- a/librabbitmq/amqp_connection.c
+++ b/librabbitmq/amqp_connection.c
@@ -75,9 +75,7 @@ amqp_connection_state_t amqp_new_connection(void)
init_amqp_pool(&state->decoding_pool, INITIAL_DECODING_POOL_PAGE_SIZE);
res = amqp_tune_connection(state, 0, INITIAL_FRAME_POOL_PAGE_SIZE, 0);
- if (-ERROR_NO_MEMORY == res) {
- return NULL;
- } else if (0 != res) {
+ if (0 != res) {
goto out_nomem;
}