From cba962134256e8b17c70dbb543ffcf935d2a53e4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 15 May 2016 00:37:36 +0200 Subject: ftp wildcard: segfault due to init only in multi_perform The proper FTP wildcard init is now more properly done in Curl_pretransfer() and the corresponding cleanup in Curl_close(). The previous place of init/cleanup code made the internal pointer to be NULL when this feature was used with the multi_socket() API, as it was made within the curl_multi_perform() function. Reported-by: Jonathan Cardoso Machado Fixes #800 --- lib/url.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index f897f5344..2a3026650 100644 --- a/lib/url.c +++ b/lib/url.c @@ -484,6 +484,12 @@ CURLcode Curl_close(struct SessionHandle *data) Curl_share_unlock(data, CURL_LOCK_DATA_SHARE); } + if(data->set.wildcardmatch) { + /* destruct wildcard structures if it is needed */ + struct WildcardData *wc = &data->wildcard; + Curl_wildcard_dtor(wc); + } + Curl_freeset(data); free(data); return CURLE_OK; -- cgit v1.2.3