Skip to content

Commit c4c4650

Browse files
committed
fix: enhance resource cleanup
Signed-off-by: rghouzra <rghouzra@student.1337.ma>
1 parent b65c9e1 commit c4c4650

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

plugins/out_oracle_log_analytics/oci_logan_conf.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,36 @@ int flb_oci_logan_conf_destroy(struct flb_oci_logan *ctx)
17591759
return 0;
17601760
}
17611761

1762+
if (ctx->imds.region) {
1763+
flb_sds_destroy(ctx->imds.region);
1764+
}
1765+
if (ctx->imds.leaf_key) {
1766+
flb_sds_destroy(ctx->imds.leaf_key);
1767+
}
1768+
if (ctx->imds.intermediate_cert) {
1769+
flb_sds_destroy(ctx->imds.intermediate_cert);
1770+
}
1771+
if (ctx->imds.fingerprint) {
1772+
flb_sds_destroy(ctx->imds.fingerprint);
1773+
}
1774+
if (ctx->imds.tenancy_ocid) {
1775+
flb_sds_destroy(ctx->imds.tenancy_ocid);
1776+
}
1777+
1778+
if (ctx->imds.session_pubkey) {
1779+
free(ctx->imds.session_pubkey);
1780+
}
1781+
if (ctx->imds.session_privkey) {
1782+
free(ctx->imds.session_privkey);
1783+
}
1784+
if (ctx->session_key_pair) {
1785+
EVP_PKEY_free(ctx->session_key_pair);
1786+
}
1787+
1788+
if (ctx->security_token.token) {
1789+
flb_sds_destroy(ctx->security_token.token);
1790+
}
1791+
17621792
if (ctx->private_key) {
17631793
flb_sds_destroy(ctx->private_key);
17641794
}
@@ -1786,7 +1816,6 @@ int flb_oci_logan_conf_destroy(struct flb_oci_logan *ctx)
17861816
if (ctx->u) {
17871817
flb_upstream_destroy(ctx->u);
17881818
}
1789-
17901819
if (ctx->oci_la_timezone) {
17911820
flb_sds_destroy(ctx->oci_la_timezone);
17921821
}

0 commit comments

Comments
 (0)