diff --git a/plugins/out_loki/loki.c b/plugins/out_loki/loki.c index 9722ebc3170..37595497cb5 100644 --- a/plugins/out_loki/loki.c +++ b/plugins/out_loki/loki.c @@ -916,13 +916,14 @@ static int prepare_remove_keys(struct flb_loki *ctx) return -1; } } - size = mk_list_size(patterns); + } + + size = mk_list_size(patterns); + if (size > 0) { flb_plg_debug(ctx->ins, "remove_mpa size: %d", size); - if (size > 0) { - ctx->remove_mpa = flb_mp_accessor_create(patterns); - if (ctx->remove_mpa == NULL) { - return -1; - } + ctx->remove_mpa = flb_mp_accessor_create(patterns); + if (ctx->remove_mpa == NULL) { + return -1; } }