cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Custom http head free memory

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 6 Nov 2012 11:52:15 +0100 (CET)

On Tue, 6 Nov 2012, huancong deng wrote:

> when i use
> curl_slist_append<http://curl.haxx.se/libcurl/c/curl_slist_append.html> to
> make my custom http head , must i free the memory like this?

> curl_slist_free_all(headers); /* free the header list */

Yes!

> i saw some example don't free the headers , like "httpcustomheader.c"

That's a bug. I fixed that example code just now. Thanks for pointing it out!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-06