From b3bcf49d50ad168883f5ccf0d3345920ff4c2a61 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Tue, 19 Nov 2024 11:35:27 +0100 Subject: [PATCH] http_common: moved initializers to correct a bug introduced in PR 9608 Signed-off-by: Leonardo Alminana --- src/flb_http_common.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/flb_http_common.c b/src/flb_http_common.c index 9b3f4d51737..b747a3a4895 100644 --- a/src/flb_http_common.c +++ b/src/flb_http_common.c @@ -519,14 +519,6 @@ int flb_http_request_set_url(struct flb_http_request *request, return -1; } - start_of_authority = strstr(local_url, "://"); - - if (start_of_authority == NULL) { - cfl_sds_destroy(local_url); - - return -1; - } - start_of_authorization = NULL; start_of_query_string = NULL; start_of_authority = NULL; @@ -536,6 +528,14 @@ int flb_http_request_set_url(struct flb_http_request *request, start_of_host = NULL; start_of_path = NULL; + start_of_authority = strstr(local_url, "://"); + + if (start_of_authority == NULL) { + cfl_sds_destroy(local_url); + + return -1; + } + start_of_authority = &start_of_authority[3]; start_of_path = strstr(start_of_authority, "/");