From d24e7add4bdc9143025f6165d4c8ec472dc89586 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 26 Sep 2013 12:54:04 +0200 Subject: [PATCH] amqp: ref the LogMessage before pushing it to the worker queue If the LogMessage is not ref()d, it will be free()d up before the worker thread pops it out of the queue, leading to severe problems. Ref it like all other drivers do. Reported-by: Alexandre Biancalana Signed-off-by: Gergely Nagy --- modules/afamqp/afamqp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/afamqp/afamqp.c b/modules/afamqp/afamqp.c index 9f20d1c3..cf9b4254 100644 --- a/modules/afamqp/afamqp.c +++ b/modules/afamqp/afamqp.c @@ -671,7 +671,7 @@ afamqp_dd_queue(LogPipe *s, LogMessage *msg, path_options = log_msg_break_ack(msg, path_options, &local_options); log_msg_add_ack(msg, path_options); - log_queue_push_tail(self->queue, msg, path_options); + log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); log_dest_driver_queue_method(s, msg, path_options, user_data); }