Skip to content

Commit

Permalink
out_logdna: adjust error checking
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Aug 8, 2023
1 parent 542dfa4 commit 768483d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/out_logdna/logdna.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,17 @@ static struct flb_logdna *logdna_config_create(struct flb_output_instance *ins,
else {
ctx->_hostname = flb_sds_create("unknown");
}
if (!ctx->_hostname) {
flb_free(ctx);
return NULL;
}
}
else {
ctx->_hostname = flb_sds_create(ctx->hostname);
}

/* Bail if unsuccessful hostname creation */
if (!ctx->_hostname) {
flb_free(ctx);
return NULL;
}

/* Create Upstream connection context */
upstream = flb_upstream_create(config,
ctx->logdna_host,
Expand Down

0 comments on commit 768483d

Please sign in to comment.