curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: segfault when reuse curl_slist

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 5 May 2017 13:56:27 +0200 (CEST)

On Fri, 5 May 2017, Pahome Chen via curl-library wrote:

> *Error situation:*
> *1st time:*
> curl_slist_append(header, ...);
> curl_easy_perform(curl);
> curl_slist_free_all(header);

... so here you free the list.

> *reuse next time:*
> curl_slist_append(header, ...);

... and now to try to reuse it again after it was freed?

> curl_easy_perform(curl); // get segfault

... because you passed in an already freed list to libcurl?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-05-05