From 2177f827c757854087f179e63016bb0980d4655e Mon Sep 17 00:00:00 2001 From: ciomaire Date: Wed, 15 Apr 2015 06:19:27 -0700 Subject: [PATCH] fix double free errors found by valgrind --- src/write_kafka.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/write_kafka.c b/src/write_kafka.c index c5c7e3df..b6e89618 100644 --- a/src/write_kafka.c +++ b/src/write_kafka.c @@ -111,6 +111,8 @@ static int kafka_handle(struct kafka_topic_context *ctx) /* {{{ */ } rd_kafka_conf_destroy(ctx->kafka_conf); + ctx->kafka_conf = NULL; + INFO ("write_kafka plugin: created KAFKA handle : %s", rd_kafka_name(ctx->kafka)); #ifdef HAVE_LIBRDKAFKA_LOGGER @@ -132,6 +134,8 @@ static int kafka_handle(struct kafka_topic_context *ctx) /* {{{ */ } rd_kafka_topic_conf_destroy(ctx->conf); + ctx->conf = NULL; + INFO ("write_kafka plugin: handle created for topic : %s", rd_kafka_topic_name(ctx->topic)); } -- 2.30.2