BUG/MEDIUM: httpclient/cli: free of unallocated hc->req.uri
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 10 Nov 2021 15:57:25 +0000 (16:57 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 10 Nov 2021 16:02:50 +0000 (17:02 +0100)
commit67b778418e6335b707c95a773f70318f96ff0664
tree677052ef60eecfe9663cc94984069d83204bcb23
parenta68a00fe28b6b39c0c166ec8d95e3bd367e8cf07
BUG/MEDIUM: httpclient/cli: free of unallocated hc->req.uri

httpclient_new() sets the hc->req.uri ist without duplicating its
memory, which is a problem since the string in the ist could be
inaccessible at some point. The API was made to use a ist which was
allocated dynamically, but httpclient_new() didn't do that, which result
in a crash when calling istfree().

This patch fixes the problem by doing an istdup()

Fix issue #1452.
src/http_client.c