diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-05-15 00:37:36 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-05-15 00:37:36 +0200 |
commit | cba962134256e8b17c70dbb543ffcf935d2a53e4 (patch) | |
tree | d23311120c5695cd72fc98764c4052cb1536bbf2 /lib/transfer.c | |
parent | e1372418cdf49fc46f284387c6abf0649df6cda0 (diff) |
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
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 5b22003dc..72f4bd9ef 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1385,6 +1385,16 @@ CURLcode Curl_pretransfer(struct SessionHandle *data) consider to be fine */ data->state.authhost.picked &= data->state.authhost.want; data->state.authproxy.picked &= data->state.authproxy.want; + + if(data->set.wildcardmatch) { + struct WildcardData *wc = &data->wildcard; + if(!wc->filelist) { + result = Curl_wildcard_init(wc); /* init wildcard structures */ + if(result) + return CURLM_OUT_OF_MEMORY; + } + } + } return result; |