cURL / Mailing Lists / curl-library / Single Mail

curl-library

When is it safe to call curl_formfree() ?

From: S. Gilles <sgilles_at_math.umd.edu>
Date: Tue, 17 May 2016 02:44:45 -0400

The man-pages (for 7.48.0) seem to disagree on one point. Suppose I
have a program in which I reuse an easy handle to make multiple POST
requests, building up a curl_httppost for each one. If I read it
correctly, the man-page for CURLOPT_HTTPPOST implies that I cannot call
curl_formfree() on any of these curl_httpposts until I call
curl_easy_cleanup() (since that would open the possibility of the same
memory being allocated and altered later, hence the data not remaining
intact). The page for curl_formfree(), however, implies that I can call
curl_formfree() immediately after curl_easy_perform() returns.

Which should I follow?

Thanks,
S. Gilles
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-17