Skip to content

Commit

Permalink
[FIX] track memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: difrin <[email protected]>
  • Loading branch information
DIFRIN committed Mar 28, 2024
1 parent 96af16c commit 1f1ea15
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/out_kafka/kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,15 @@ int produce_message(struct flb_time *tm, msgpack_object *map,
flb_warn("Field '%s' not found or not a string value", field_name);
}

flb_free(field_name); // Free allocated memory
}

}
else {
/* Static header value */
rd_kafka_header_add(kafka_headers, hkey->str, flb_sds_len(hkey->str),
hval->str, flb_sds_len(hval->str));
}
}

flb_free(field_name); // Free allocated memory
}
}
else {
Expand Down

0 comments on commit 1f1ea15

Please sign in to comment.