Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Sep 30

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 270b6fb4e295ef1f24545b72eda33281088b46e0:

examples: add mobile storage test (2026-09-23 13:34:06 -0400)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 86196b9b9104b87a81ca5e54c87b8acf471d8cad:

Merge branch 'http-slist-leak' of https://github.com/niharika-khare/fio (2026-09-29 13:27:05 -0400)

----------------------------------------------------------------
Niharika Khare (1):
engines/http: fix curl_slist leak in S3 and Swift header helpers

Vincent Fu (1):
Merge branch 'http-slist-leak' of https://github.com/niharika-khare/fio

 engines/http.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

---

Diff of recent changes:

engines/http.c +6 -4
index 83891f1f..f0bf40ce 100644
@@ -445,7 +445,7 @@ static int _curl_trace(CURL *handle, curl_infotype type,
 /* https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
  * https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html#signing-request-intro
  */
-static void _add_aws_auth_header(CURL *curl, struct curl_slist *slist, struct http_options *o,
+static struct curl_slist* _add_aws_auth_header(CURL *curl, struct curl_slist *slist, struct http_options *o,
 		int op, const char *uri, char *buf, size_t len)
 {
 	char date_short[16];
@@ -610,9 +610,10 @@ static void _add_aws_auth_header(CURL *curl, struct curl_slist *slist, struct ht
 		free(sse_key_base64);
 		free(sse_key_md5_base64);
 	}
+	return slist;
 }
 
-static void _add_swift_header(CURL *curl, struct curl_slist *slist, struct http_options *o,
+static struct curl_slist* _add_swift_header(CURL *curl, struct curl_slist *slist, struct http_options *o,
 		int op, const char *uri, char *buf, size_t len)
 {
 	char *dsha = NULL;
@@ -633,6 +634,7 @@ static void _add_swift_header(CURL *curl, struct curl_slist *slist, struct http_
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
 
 	free(dsha);
+	return slist;
 }
 
 static struct curl_slist* _append_range_header(struct curl_slist *slist, unsigned long long offset, unsigned long long length, unsigned long long file_size)
@@ -740,10 +742,10 @@ static enum fio_q_status fio_http_queue(struct thread_data *td,
 		slist = _append_range_header(slist, io_u->offset, io_u->xfer_buflen, io_u->file->real_file_size);
 
 	if (o->mode == FIO_HTTP_S3)
-		_add_aws_auth_header(http->curl, slist, o, io_u->ddir, object_path,
+		slist = _add_aws_auth_header(http->curl, slist, o, io_u->ddir, object_path,
 			io_u->xfer_buf, io_u->xfer_buflen);
 	else if (o->mode == FIO_HTTP_SWIFT)
-		_add_swift_header(http->curl, slist, o, io_u->ddir, object_path,
+		slist = _add_swift_header(http->curl, slist, o, io_u->ddir, object_path,
 			io_u->xfer_buf, io_u->xfer_buflen);
 
 	if (io_u->ddir == DDIR_WRITE) {