diff options
Diffstat (limited to 'Utilities/cmcurl/lib/wildcard.c')
-rw-r--r-- | Utilities/cmcurl/lib/wildcard.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Utilities/cmcurl/lib/wildcard.c b/Utilities/cmcurl/lib/wildcard.c index af45c79..8ba0989 100644 --- a/Utilities/cmcurl/lib/wildcard.c +++ b/Utilities/cmcurl/lib/wildcard.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -30,9 +30,15 @@ #include "curl_memory.h" #include "memdebug.h" +static void fileinfo_dtor(void *user, void *element) +{ + (void)user; + Curl_fileinfo_cleanup(element); +} + CURLcode Curl_wildcard_init(struct WildcardData *wc) { - Curl_llist_init(&wc->filelist, Curl_fileinfo_dtor); + Curl_llist_init(&wc->filelist, fileinfo_dtor); wc->state = CURLWC_INIT; return CURLE_OK; @@ -43,12 +49,12 @@ void Curl_wildcard_dtor(struct WildcardData *wc) if(!wc) return; - if(wc->tmp_dtor) { - wc->tmp_dtor(wc->tmp); - wc->tmp_dtor = ZERO_NULL; - wc->tmp = NULL; + if(wc->dtor) { + wc->dtor(wc->protdata); + wc->dtor = ZERO_NULL; + wc->protdata = NULL; } - DEBUGASSERT(wc->tmp == NULL); + DEBUGASSERT(wc->protdata == NULL); Curl_llist_destroy(&wc->filelist, NULL); |