2011-09-16 15:44:45 -04:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 - 2011, 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
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
#include "setup.h"
|
|
|
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
#include "tool_cfgable.h"
|
|
|
|
|
|
|
|
#include "memdebug.h" /* keep this as LAST include */
|
|
|
|
|
2011-09-17 08:09:36 -04:00
|
|
|
/* TODO: review handling of unhandled fields marked below */
|
2011-09-16 15:44:45 -04:00
|
|
|
|
|
|
|
void free_config_fields(struct Configurable *config)
|
|
|
|
{
|
2011-09-23 23:32:51 -04:00
|
|
|
struct getout *urlnode;
|
|
|
|
|
2011-09-17 08:09:36 -04:00
|
|
|
if(config->easy) {
|
|
|
|
curl_easy_cleanup(config->easy);
|
|
|
|
config->easy = NULL;
|
|
|
|
}
|
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->random_file);
|
|
|
|
Curl_safefree(config->egd_file);
|
2011-09-17 19:58:18 -04:00
|
|
|
Curl_safefree(config->useragent);
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->cookie);
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->cookiejar);
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->cookiefile);
|
2011-09-17 08:09:36 -04:00
|
|
|
|
|
|
|
Curl_safefree(config->postfields);
|
|
|
|
Curl_safefree(config->referer);
|
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->headerfile);
|
|
|
|
Curl_safefree(config->ftpport);
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->iface);
|
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->range);
|
|
|
|
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->userpwd);
|
|
|
|
Curl_safefree(config->tls_username);
|
|
|
|
Curl_safefree(config->tls_password);
|
|
|
|
Curl_safefree(config->tls_authtype);
|
|
|
|
Curl_safefree(config->proxyuserpwd);
|
|
|
|
Curl_safefree(config->proxy);
|
|
|
|
|
|
|
|
Curl_safefree(config->noproxy);
|
|
|
|
Curl_safefree(config->mail_from);
|
|
|
|
curl_slist_free_all(config->mail_rcpt);
|
2011-09-16 15:44:45 -04:00
|
|
|
|
|
|
|
Curl_safefree(config->netrc_file);
|
2011-09-17 08:09:36 -04:00
|
|
|
|
2011-09-23 23:32:51 -04:00
|
|
|
urlnode = config->url_list;
|
|
|
|
while(urlnode) {
|
|
|
|
struct getout *next = urlnode->next;
|
|
|
|
Curl_safefree(urlnode->url);
|
|
|
|
Curl_safefree(urlnode->outfile);
|
|
|
|
Curl_safefree(urlnode->infile);
|
|
|
|
Curl_safefree(urlnode);
|
|
|
|
urlnode = next;
|
|
|
|
}
|
|
|
|
config->url_list = NULL;
|
|
|
|
config->url_last = NULL;
|
|
|
|
config->url_get = NULL;
|
|
|
|
config->url_out = NULL;
|
2011-09-17 08:09:36 -04:00
|
|
|
|
|
|
|
Curl_safefree(config->cipher_list);
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->cert);
|
|
|
|
Curl_safefree(config->cert_type);
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->cacert);
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->capath);
|
|
|
|
Curl_safefree(config->crlfile);
|
|
|
|
Curl_safefree(config->key);
|
|
|
|
Curl_safefree(config->key_type);
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->key_passwd);
|
2011-09-16 15:44:45 -04:00
|
|
|
Curl_safefree(config->pubkey);
|
|
|
|
Curl_safefree(config->hostpubmd5);
|
2011-09-23 23:32:51 -04:00
|
|
|
Curl_safefree(config->engine);
|
2011-09-16 15:44:45 -04:00
|
|
|
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->customrequest);
|
|
|
|
Curl_safefree(config->krblevel);
|
|
|
|
Curl_safefree(config->trace_dump);
|
|
|
|
|
2011-09-23 23:32:51 -04:00
|
|
|
config->trace_stream = NULL; /* closed elsewhere when appropriate */
|
2011-09-17 08:09:36 -04:00
|
|
|
|
|
|
|
Curl_safefree(config->writeout);
|
|
|
|
|
2011-09-23 23:32:51 -04:00
|
|
|
config->errors = NULL; /* closed elsewhere when appropriate */
|
2011-09-17 08:09:36 -04:00
|
|
|
|
|
|
|
curl_slist_free_all(config->quote);
|
2011-09-16 15:44:45 -04:00
|
|
|
curl_slist_free_all(config->postquote);
|
2011-09-17 08:09:36 -04:00
|
|
|
curl_slist_free_all(config->prequote);
|
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
curl_slist_free_all(config->headers);
|
2011-09-17 08:09:36 -04:00
|
|
|
|
|
|
|
if(config->httppost) {
|
|
|
|
curl_formfree(config->httppost);
|
|
|
|
config->httppost = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* config->last_post not handled */
|
|
|
|
|
2011-09-16 15:44:45 -04:00
|
|
|
curl_slist_free_all(config->telnet_options);
|
|
|
|
curl_slist_free_all(config->resolve);
|
|
|
|
|
2011-09-17 08:09:36 -04:00
|
|
|
Curl_safefree(config->socksproxy);
|
|
|
|
Curl_safefree(config->socks5_gssapi_service);
|
|
|
|
|
|
|
|
Curl_safefree(config->ftp_account);
|
|
|
|
Curl_safefree(config->ftp_alternative_to_user);
|
|
|
|
|
|
|
|
Curl_safefree(config->libcurl);
|
2011-09-16 15:44:45 -04:00
|
|
|
}
|
2011-09-17 19:58:18 -04:00
|
|
|
|