From 54f1c6fefef4423d1862987470150fe4a4a0ba33 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 2 Sep 2019 11:45:10 -0600 Subject: [PATCH] storage: on exit validate Chunk I/O context Signed-off-by: Eduardo Silva --- src/flb_storage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/flb_storage.c b/src/flb_storage.c index 9c9fe2ef39b..914322bab16 100644 --- a/src/flb_storage.c +++ b/src/flb_storage.c @@ -284,8 +284,12 @@ void flb_storage_destroy(struct flb_config *ctx) /* Destroy Chunk I/O context */ cio = (struct cio_ctx *) ctx->cio; - cio_destroy(cio); + if (!cio) { + return; + } + + cio_destroy(cio); if (ctx->storage_bl_mem_limit) { flb_free(ctx->storage_bl_mem_limit); }