From a215630d5c513741453827027b326a440d6e3542 Mon Sep 17 00:00:00 2001 From: adiforluls Date: Fri, 22 Sep 2023 12:32:36 +0530 Subject: [PATCH] fix style Signed-off-by: adiforluls --- plugins/out_oracle_log_analytics/oci_client.c | 7 ++++--- plugins/out_oracle_log_analytics/oci_logan_conf.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/out_oracle_log_analytics/oci_client.c b/plugins/out_oracle_log_analytics/oci_client.c index bbb47b7f857..4dcaed5d9bb 100644 --- a/plugins/out_oracle_log_analytics/oci_client.c +++ b/plugins/out_oracle_log_analytics/oci_client.c @@ -264,12 +264,13 @@ flb_sds_t refresh_cert(struct flb_upstream *u, flb_sds_t get_tenancy_id_from_certificate(X509 *cert) { flb_sds_t t_id = NULL; + int i; const unsigned char *str; char* x; X509_NAME *subj = X509_get_subject_name(cert); - for (int i = 0; i < X509_NAME_entry_count(subj); i++) { + for (i = 0; i < X509_NAME_entry_count(subj); i++) { X509_NAME_ENTRY *e = X509_NAME_get_entry(subj, i); ASN1_STRING *d = X509_NAME_ENTRY_get_data(e); str = ASN1_STRING_get0_data(d); @@ -329,7 +330,8 @@ char* sanitize_certificate_string(flb_sds_t cert_pem) void colon_separated_fingerprint(unsigned char* readbuf, void *writebuf, size_t len) { char *l; - for(size_t i=0; i < len-1; i++) { + size_t i; + for(i=0; i < len-1; i++) { l = (char*) (3*i + ((intptr_t) writebuf)); sprintf(l, "%02x:", readbuf[i]); } @@ -648,7 +650,6 @@ const char* get_token_exp(flb_sds_t token_string, char *val; int key_len; int val_len; - flb_sds_t token = NULL; jsmn_init(&parser); diff --git a/plugins/out_oracle_log_analytics/oci_logan_conf.c b/plugins/out_oracle_log_analytics/oci_logan_conf.c index 1dd3596b9a2..80bb3cb6c8a 100644 --- a/plugins/out_oracle_log_analytics/oci_logan_conf.c +++ b/plugins/out_oracle_log_analytics/oci_logan_conf.c @@ -178,8 +178,6 @@ static int build_federation_client_headers(struct flb_oci_logan *ctx, flb_sds_t signature = NULL; flb_sds_t auth_header_str = NULL; - flb_sds_t tmp_ref = NULL; - size_t tmp_len = 0; unsigned char sha256_buf[32] = { 0 }; @@ -937,6 +935,8 @@ struct flb_oci_logan *flb_oci_logan_conf_create(struct flb_output_instance *ins, return NULL; } + build_region_table(ctx); + if (strcasecmp(ctx->auth_type, INSTANCE_PRINCIPAL) == 0) { ctx->cert_u = flb_upstream_create(config, METADATA_HOST_BASE, 80, FLB_IO_TCP, NULL); }