Clear CURL opts after use

FossilOrigin-Name: ebeab2504f43c09a5c840b26f64540316f3087706fbc57694a0d491b2476eac8
This commit is contained in:
nekobit 2022-07-02 04:31:55 +00:00
parent 879cd9db22
commit 2c1a88ee03
2 changed files with 4 additions and 0 deletions

View file

@ -282,5 +282,6 @@ void mstdnt_cleanup_accounts(struct mstdnt_account* accts, size_t len)
if (!accts) return;
for (int i = 0; i < len; ++i)
mstdnt_cleanup_account(accts + i);
free(accts);
}

View file

@ -88,10 +88,13 @@ int mastodont_fetch_curl(mastodont_t* mstdnt,
res = curl_easy_perform(mstdnt->curl);
// Reset values that are optional
// Reset if custom
if (is_custom)
curl_easy_setopt(mstdnt->curl, request_t, NULL);
curl_easy_setopt(mstdnt->curl, CURLOPT_HTTPHEADER, NULL);
if (list) curl_slist_free_all(list);
return res;