1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
24 #include <curl/curl.h>
26 #include "tool_cfgable.h"
28 #include "memdebug.h" /* keep this as LAST include */
30 /* TODO: review handling of unhandled fields marked below */
32 void free_config_fields(struct Configurable *config)
35 curl_easy_cleanup(config->easy);
39 Curl_safefree(config->random_file);
40 Curl_safefree(config->egd_file);
41 Curl_safefree(config->useragent);
42 Curl_safefree(config->cookie);
43 Curl_safefree(config->cookiejar);
44 Curl_safefree(config->cookiefile);
46 Curl_safefree(config->postfields);
47 Curl_safefree(config->referer);
49 Curl_safefree(config->headerfile);
50 Curl_safefree(config->ftpport);
51 Curl_safefree(config->iface);
53 Curl_safefree(config->range);
55 Curl_safefree(config->userpwd);
56 Curl_safefree(config->tls_username);
57 Curl_safefree(config->tls_password);
58 Curl_safefree(config->tls_authtype);
59 Curl_safefree(config->proxyuserpwd);
60 Curl_safefree(config->proxy);
62 Curl_safefree(config->noproxy);
63 Curl_safefree(config->mail_from);
64 curl_slist_free_all(config->mail_rcpt);
66 Curl_safefree(config->netrc_file);
68 /* config->url_list not handled */
69 /* config->url_last not handled */
70 /* config->url_get not handled */
71 /* config->url_out not handled */
73 Curl_safefree(config->cipher_list);
74 Curl_safefree(config->cert);
75 Curl_safefree(config->cert_type);
76 Curl_safefree(config->cacert);
77 Curl_safefree(config->capath);
78 Curl_safefree(config->crlfile);
79 Curl_safefree(config->key);
80 Curl_safefree(config->key_type);
81 Curl_safefree(config->key_passwd);
82 Curl_safefree(config->pubkey);
83 Curl_safefree(config->hostpubmd5);
85 /* config->engine not handled */
87 Curl_safefree(config->customrequest);
88 Curl_safefree(config->krblevel);
89 Curl_safefree(config->trace_dump);
91 /* config->trace_stream not handled */
93 Curl_safefree(config->writeout);
95 /* config->errors not handled */
97 curl_slist_free_all(config->quote);
98 curl_slist_free_all(config->postquote);
99 curl_slist_free_all(config->prequote);
101 curl_slist_free_all(config->headers);
103 if(config->httppost) {
104 curl_formfree(config->httppost);
105 config->httppost = NULL;
108 /* config->last_post not handled */
110 curl_slist_free_all(config->telnet_options);
111 curl_slist_free_all(config->resolve);
113 Curl_safefree(config->socksproxy);
114 Curl_safefree(config->socks5_gssapi_service);
116 Curl_safefree(config->ftp_account);
117 Curl_safefree(config->ftp_alternative_to_user);
119 Curl_safefree(config->libcurl);
121 /* config->outs not handled */