Skip to content

Commit

Permalink
http_common: moved initializers to correct a bug introduced in PR 9608
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <leonardo.alminana@chronosphere.io>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Nov 19, 2024
1 parent b8110f9 commit 8994bfc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/flb_http_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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, "/");
Expand Down

0 comments on commit 8994bfc

Please sign in to comment.