diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-07-27 05:56:12 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-07-27 05:56:12 +0800 |
commit | d5f77c20a8fac411744b8f444693010f28c9aeb4 (patch) | |
tree | bc5392cc0a0525529ce9cbad8cb0ff684c7aae7e /camel | |
parent | 85c38af8b431e9bc0a6fe8f3c96f21cedb6f935d (diff) | |
download | gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar.gz gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar.bz2 gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar.lz gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar.xz gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.tar.zst gsoc2013-evolution-d5f77c20a8fac411744b8f444693010f28c9aeb4.zip |
Allow the url to be NULL just like the libc free convention.
2001-07-26 Jeffrey Stedfast <fejj@ximian.com>
* camel-url.c (camel_url_free): Allow the url to be NULL just like
the libc free convention.
svn path=/trunk/; revision=11437
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | camel/camel-mime-utils.c | 6 | ||||
-rw-r--r-- | camel/camel-url.c | 26 |
3 files changed, 23 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c8c34fc609..056a488f9b 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2001-07-26 Jeffrey Stedfast <fejj@ximian.com> + + * camel-url.c (camel_url_free): Allow the url to be NULL just like + the libc free convention. + 2001-07-26 Dan Winship <danw@ximian.com> * providers/imap/camel-imap-command.c (camel_imap_command_start): diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index 13b8253926..8116829b7f 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -2844,7 +2844,7 @@ header_encode_param (const unsigned char *in, gboolean *encoded) } void -header_param_list_format_append(GString *out, struct _header_param *p) +header_param_list_format_append (GString *out, struct _header_param *p) { int used = out->len; @@ -2861,6 +2861,10 @@ header_param_list_format_append(GString *out, struct _header_param *p) } value = header_encode_param (p->value, &encoded); + if (!value) { + g_warning ("appending parameter %s=%s violates rfc2184", p->name, p->value); + value = g_strdup (p->value); + } if (!encoded) { char *ch; diff --git a/camel/camel-url.c b/camel/camel-url.c index 9913eb3269..4290b4c813 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -390,19 +390,19 @@ output_param (GQuark key_id, gpointer data, gpointer user_data) void camel_url_free (CamelURL *url) { - g_return_if_fail (url); - - g_free (url->protocol); - g_free (url->user); - g_free (url->authmech); - g_free (url->passwd); - g_free (url->host); - g_free (url->path); - g_datalist_clear (&url->params); - g_free (url->query); - g_free (url->fragment); - - g_free (url); + if (url) { + g_free (url->protocol); + g_free (url->user); + g_free (url->authmech); + g_free (url->passwd); + g_free (url->host); + g_free (url->path); + g_datalist_clear (&url->params); + g_free (url->query); + g_free (url->fragment); + + g_free (url); + } } |