php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch Fix_memory_leak_in_AMQPQueue_declare for amqp Bug #63717

Patch version 2012-12-07 12:01 UTC

Return to Bug #63717 | Download this patch
Patch Revisions:

Developer: coodix@gmail.com

From cbb3df69062b9ecec243e2e26db46b869845d9c2 Mon Sep 17 00:00:00 2001
From: coodix <coodix@gmail.com>
Date: Fri, 7 Dec 2012 15:50:09 +0400
Subject: [PATCH] fix memory leak in queue->declare method

---
 amqp_queue.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/amqp_queue.c b/amqp_queue.c
index 0e541a5..bc5dd20 100644
--- a/amqp_queue.c
+++ b/amqp_queue.c
@@ -742,6 +742,7 @@ PHP_METHOD(amqp_queue_class, declareQueue)
 		amqp_error(res, pstr);
 		channel->is_connected = '\0';
 		zend_throw_exception(amqp_queue_exception_class_entry, *pstr, 0 TSRMLS_CC);
+		amqp_maybe_release_buffers(connection->connection_resource->connection_state);
 		return;
 	}
 	
@@ -752,6 +753,8 @@ PHP_METHOD(amqp_queue_class, declareQueue)
 	AMQP_SET_NAME(queue, name);
 	efree(name);
 	
+	amqp_maybe_release_buffers(connection->connection_resource->connection_state);
+	
 	RETURN_LONG(message_count);
 }
 /* }}} */
-- 
1.7.10.msysgit.1

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC