mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-11 05:52:17 -04:00
http: free curl header list on error
This commit is contained in:
1 parent
9fbade4573
commit
fdadbaaad5
1 file changed
+2
@@ -64,6 +64,8 @@ pub const Headers = struct {
|
||||
if (header_list == null) {
|
||||
return error.OutOfMemory;
|
||||
}
|
||||
// libcurl leaves the list intact when curl_slist_append fails, so we own it.
|
||||
errdefer libcurl.curl_slist_free_all(header_list);
|
||||
|
||||
// Always add sec-CH-UA header
|
||||
const with_sec_ch_ua = libcurl.curl_slist_append(header_list, Config.HttpHeaders.sec_ch_ua);
|
||||
|
||||
Reference in new issue
Block a user