Skip to content

Commit

Permalink
out_stackdriver: fix leak (CID 313112)
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Feb 13, 2021
1 parent 69b4f2f commit 7962ad6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/out_stackdriver/stackdriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ static int stackdriver_format(struct flb_config *config,

/* Parameters for log name */
int log_name_extracted = FLB_FALSE;
flb_sds_t log_name;
flb_sds_t log_name = NULL;

/* Parameters for insertId */
msgpack_object insert_id_obj;
Expand Down Expand Up @@ -1719,6 +1719,9 @@ static int stackdriver_format(struct flb_config *config,
insert_id_extracted = FLB_FALSE;
}
else {
if (log_name_extracted == FLB_TRUE) {
flb_sds_destroy(log_name);
}
continue;
}

Expand Down

0 comments on commit 7962ad6

Please sign in to comment.