Skip to content

Commit 657ca61

Browse files
committed
processor_tda: Plug allocated assignments after releasing
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 4cf2db2 commit 657ca61

File tree

1 file changed

+4
-0
lines changed
  • plugins/processor_tda

1 file changed

+4
-0
lines changed

plugins/processor_tda/tda.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ static int tda_build_groups(struct tda_proc_ctx *ctx, struct cmt *cmt)
422422
ctx->last_vec = flb_calloc(ctx->feature_dim, sizeof(double));
423423
if (!ctx->last_vec) {
424424
flb_errno();
425+
/* Clean up what we just assigned */
426+
ctx->groups = NULL;
427+
ctx->group_list = NULL;
428+
ctx->feature_dim = 0;
425429
goto error;
426430
}
427431
ctx->last_ts = 0;

0 commit comments

Comments
 (0)