Code

fix double free errors found by valgrind
authorciomaire <cmacaniomaire@gmail.com>
Wed, 15 Apr 2015 13:19:27 +0000 (06:19 -0700)
committerciomaire <cmacaniomaire@gmail.com>
Wed, 15 Apr 2015 13:19:27 +0000 (06:19 -0700)
src/write_kafka.c

index c5c7e3df9b3bac47b78b3fd216b13655b308b2c1..b6e89618ec9ddbf51738556171ace8b278944130 100644 (file)
@@ -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));
     }