From d613b2ea9ccaa84924305a73c38c4d60bd38ee9f Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Wed, 12 Apr 2017 09:51:55 -0600 Subject: [PATCH] out_forward: if secure forward handshake fails do a proper exit Signed-off-by: Eduardo Silva --- plugins/out_forward/forward.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/out_forward/forward.c b/plugins/out_forward/forward.c index 85551da40c5..6c4d8c1f5fa 100644 --- a/plugins/out_forward/forward.c +++ b/plugins/out_forward/forward.c @@ -517,6 +517,11 @@ void cb_forward_flush(void *data, size_t bytes, if (ctx->secured == FLB_TRUE) { ret = secure_forward_handshake(u_conn, ctx); flb_debug("[out_fw] handshake status = %i", ret); + if (ret == -1) { + flb_upstream_conn_release(u_conn); + msgpack_sbuffer_destroy(&mp_sbuf); + FLB_OUTPUT_RETURN(FLB_RETRY); + } } #endif