From 93ff02b44f937ce629d9ee8d20403cba80b84d39 Mon Sep 17 00:00:00 2001 From: Rachel Tucker Date: Thu, 24 Sep 2020 11:41:59 -0600 Subject: [PATCH] Issue-229: Memory error after 'Request encountered a 307 redirect'. --- src/ds3_net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ds3_net.c b/src/ds3_net.c index db298438..b9f40983 100644 --- a/src/ds3_net.c +++ b/src/ds3_net.c @@ -588,7 +588,6 @@ ds3_error* net_process_request(const ds3_client* client, } ds3_string_multimap_free(response_headers); ds3_str_free(response_data.status_message); - g_free(url); if (response_data.status_code == 307) { ds3_log_message(client->log, DS3_INFO, "Request encountered a 307 redirect"); @@ -601,9 +600,11 @@ ds3_error* net_process_request(const ds3_client* client, error->message = ds3_str_init("Encountered too many redirects while attempting to fulfill the request"); error->code = DS3_ERROR_TOO_MANY_REDIRECTS; } else { + ds3_error_free(error); continue; } } + g_free(url); return error; } g_byte_array_free(response_data.body, TRUE);