diff --git a/plugins/out_azure_blob/azure_blob.c b/plugins/out_azure_blob/azure_blob.c index 57ffd90ad43..69bcc0713f9 100644 --- a/plugins/out_azure_blob/azure_blob.c +++ b/plugins/out_azure_blob/azure_blob.c @@ -2430,6 +2430,10 @@ static int cb_worker_exit(void *data, struct flb_config *config) struct worker_info *info; struct flb_azure_blob *ctx = data; + if (!ctx) { + return 0; + } + flb_plg_info(ctx->ins, "initializing worker"); info = FLB_TLS_GET(worker_info); diff --git a/plugins/out_kafka_rest/kafka.c b/plugins/out_kafka_rest/kafka.c index f1e5efc2d19..272c63df092 100644 --- a/plugins/out_kafka_rest/kafka.c +++ b/plugins/out_kafka_rest/kafka.c @@ -338,6 +338,10 @@ static int cb_kafka_exit(void *data, struct flb_config *config) { struct flb_kafka_rest *ctx = data; + if (!ctx) { + return 0; + } + flb_kr_conf_destroy(ctx); return 0; } diff --git a/plugins/out_kafka_rest/kafka_conf.c b/plugins/out_kafka_rest/kafka_conf.c index eae5dc9da81..f428c8f3be1 100644 --- a/plugins/out_kafka_rest/kafka_conf.c +++ b/plugins/out_kafka_rest/kafka_conf.c @@ -197,6 +197,10 @@ struct flb_kafka_rest *flb_kr_conf_create(struct flb_output_instance *ins, int flb_kr_conf_destroy(struct flb_kafka_rest *ctx) { + if (!ctx) { + return 0; + } + flb_free(ctx->topic); flb_free(ctx->http_user); flb_free(ctx->http_passwd); diff --git a/plugins/out_nats/nats.c b/plugins/out_nats/nats.c index 589b57061a4..ef4b8ea8042 100644 --- a/plugins/out_nats/nats.c +++ b/plugins/out_nats/nats.c @@ -231,6 +231,10 @@ int cb_nats_exit(void *data, struct flb_config *config) (void) config; struct flb_out_nats_config *ctx = data; + if (!ctx) { + return 0; + } + flb_upstream_destroy(ctx->u); flb_free(ctx);