axboe / fio

Flexible I/O Tester
GNU General Public License v2.0
5.21k stars 1.26k forks source link

One place memory leak #1752

Open lynnux opened 5 months ago

lynnux commented 5 months ago

https://github.com/axboe/fio/blob/5b347a1d4e5fd81b6a1b515843b834c39fb3463d/engines/http.c#L717 the slist passed into _add_aws_auth_header, it's realloced by curl_slist_append , but in fio_http_queue the slist always 0.

vincentkfu commented 5 months ago

What do you think is the best fix?

slist does not need to be passed to _add_aws_auth_header or _add_swift_header. It seems to me that the least intrusive fix would be to have those two functions return slist and then curl_slist_free_all will have a non-null parameter.

Feel free to send a patch.