From 6c68a302f6bd33caa770e669c12aa46b3ae666f2 Mon Sep 17 00:00:00 2001 From: Aditya Prajapati Date: Wed, 12 Oct 2022 23:23:52 +0530 Subject: [PATCH] in_event_type: use flb_ versions for malloc and free Signed-off-by: Aditya Prajapati --- plugins/in_event_type/event_type.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/in_event_type/event_type.c b/plugins/in_event_type/event_type.c index 5661f7a1c16..0d152a7e232 100644 --- a/plugins/in_event_type/event_type.c +++ b/plugins/in_event_type/event_type.c @@ -45,7 +45,7 @@ static struct ctrace_id *create_random_span_id() ssize_t ret; struct ctrace_id *cid; - buf = calloc(1, OTEL_SPAN_ID_LEN); + buf = flb_malloc(OTEL_SPAN_ID_LEN); if (!buf) { ctr_errno(); return NULL; @@ -53,12 +53,12 @@ static struct ctrace_id *create_random_span_id() ret = ctr_random_get(buf, OTEL_SPAN_ID_LEN); if (ret < 0) { - free(buf); + flb_free(buf); return NULL; } cid = ctr_id_create(buf, OTEL_SPAN_ID_LEN); - free(buf); + flb_free(buf); return cid;