Skip to content

Commit

Permalink
out_splunk: release flb_ra_translate result buffer on failure
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich committed Aug 31, 2023
1 parent a59ff90 commit 0cbf127
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/out_splunk/splunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ static inline int pack_event_key(struct flb_splunk *ctx, msgpack_packer *mp_pck,
t = flb_time_to_double(tm);
val = flb_ra_translate(ctx->ra_event_key, tag, tag_len, map, NULL);
if (!val || flb_sds_len(val) == 0) {
if (val != NULL) {
flb_sds_destroy(val);
}

return -1;
}

Expand Down

0 comments on commit 0cbf127

Please sign in to comment.