fixed memory leak by calling curl_slist_free_all(headers)