Skip to content

Commit

Permalink
out_azure_logs_ingestion: fix NULL dereference (#7624)
Browse files Browse the repository at this point in the history
The code checks if `ctx` is NULL, and if it is' NULL proceeds to
dereference `ctx` by way of `ctx->ins`. As such, there will always be a
NULL dereference if the condition `if (!ctx)` is true. This fixes it by
removing the dereference.
  • Loading branch information
DavidKorczynski authored Sep 23, 2023
1 parent d55619e commit b94bffa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/out_azure_logs_ingestion/azure_logs_ingestion.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int cb_azure_logs_ingestion_init(struct flb_output_instance *ins,
/* Allocate and initialize a context from configuration */
ctx = flb_az_li_ctx_create(ins, config);
if (!ctx) {
flb_plg_error(ctx->ins, "configuration failed");
flb_plg_error(ins, "configuration failed");
return -1;
}

Expand Down

0 comments on commit b94bffa

Please sign in to comment.