diff options
author | Yang Tse <yangsita@gmail.com> | 2010-06-10 02:30:23 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-06-10 02:30:23 +0200 |
commit | 54aca3c5ecdfbeaa7be195f4950bba78e6229a18 (patch) | |
tree | 081ec57104d3d7fb49538ec42f52dbc0b38bda86 | |
parent | 0a9cf4365a1a80b2e8f28a59f3f2ae49b63865fc (diff) |
ensure that Curl_wildcard_dtor() leaves WildcardData struct zero initialized
-rw-r--r-- | lib/wildcard.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/wildcard.c b/lib/wildcard.c index 0fe153c5f..9fe5d5135 100644 --- a/lib/wildcard.c +++ b/lib/wildcard.c @@ -34,6 +34,7 @@ CURLcode Curl_wildcard_init(struct WildcardData *wc) { + DEBUGASSERT(wc->filelist == NULL); /* now allocate only wc->filelist, everything else will be allocated if it is needed. */ wc->filelist = Curl_llist_alloc(Curl_fileinfo_dtor); @@ -50,8 +51,10 @@ void Curl_wildcard_dtor(struct WildcardData *wc) if(wc->tmp_dtor) { wc->tmp_dtor(wc->tmp); + wc->tmp_dtor = ZERO_NULL; wc->tmp = NULL; } + DEBUGASSERT(wc->tmp == NULL); if(wc->filelist) { Curl_llist_destroy(wc->filelist, NULL); @@ -67,5 +70,7 @@ void Curl_wildcard_dtor(struct WildcardData *wc) free(wc->pattern); wc->pattern = NULL; } + wc->customptr = NULL; + wc->state = CURLWC_INIT; } |