Skip to content

Commit

Permalink
upstream_ha: Plug memory leaks
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Aug 13, 2024
1 parent 599b9dd commit dd1ccf2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/flb_upstream_ha.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,32 @@ static struct flb_upstream_node *create_node(int id,
tls_debug, tls_vhost, tls_ca_path, tls_ca_file,
tls_crt_file, tls_key_file,
tls_key_passwd, ht, config);

/* Teardown for created flb_sds_t stuffs by flb_cf_section_property_get_string(). */
if (tls_vhost != NULL) {
flb_sds_destroy(tls_vhost);
}

if (tls_ca_path != NULL) {
flb_sds_destroy(tls_ca_path);
}

if (tls_ca_file != NULL) {
flb_sds_destroy(tls_ca_file);
}

if (tls_crt_file != NULL) {
flb_sds_destroy(tls_crt_file);
}

if (tls_key_file != NULL) {
flb_sds_destroy(tls_key_file);
}

if (tls_key_passwd != NULL) {
flb_sds_destroy(tls_key_passwd);
}

return node;
}

Expand Down

0 comments on commit dd1ccf2

Please sign in to comment.