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 <[email protected]>
  • Loading branch information
leonardo-albertovich committed Nov 19, 2024
1 parent b8110f9 commit b3bcf49
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 b3bcf49

Please sign in to comment.