Skip to content

Commit

Permalink
in_splunk: ensure releasing tag_from_record
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Nov 4, 2023
1 parent ac4ec1f commit cf0f9c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/in_splunk/splunk_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ static void process_flb_log_append(struct flb_splunk *ctx, msgpack_object *recor
flb_sds_len(tag_from_record),
ctx->log_encoder.output_buffer,
ctx->log_encoder.output_length);

flb_sds_destroy(tag_from_record);
}
else if (tag) {
flb_input_log_append(ctx->ins, tag, flb_sds_len(tag),
Expand All @@ -310,6 +308,10 @@ static void process_flb_log_append(struct flb_splunk *ctx, msgpack_object *recor
else {
flb_plg_error(ctx->ins, "Error encoding record : %d", ret);
}

if (tag_from_record) {
flb_sds_destroy(tag_from_record);
}
}

static int process_json_payload_pack(struct flb_splunk *ctx, flb_sds_t tag, char *buf, size_t size)
Expand Down

0 comments on commit cf0f9c7

Please sign in to comment.