Add different checks in curl for memory errors and !CURLE_OK status code