aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-09-01 19:53:18 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-01 19:53:18 +0800
commitf5be7984b2ea1a4c3591cc11090220c080216aec (patch)
tree5b68ba93733115cc451adce0b674ececa9122f2c /camel/camel-mime-part.c
parenta5dc758170c40d86ee361f607eae62aa6e7509d8 (diff)
downloadgsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar.gz
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar.bz2
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar.lz
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar.xz
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.tar.zst
gsoc2013-evolution-f5be7984b2ea1a4c3591cc11090220c080216aec.zip
When using g_free (obj) don't test if obj != NULL g_free () already do
1999-09-01 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-folder.c (_finalize): (_set_name): * camel/camel-mime-message.c (_finalize): * camel/camel-mime-part.c (_finalize): (_set_description): (_set_disposition): * camel/camel-service.c (_finalize): * camel/camel-stream-fs.c (_finalize): * camel/gmime-content-field.c: (gmime_content_field_construct_from_string): * camel/url-util.c (g_url_free): When using g_free (obj) don't test if obj != NULL g_free () already do that. Thanks to elerium for the feedback. 19 svn path=/trunk/; revision=1151
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index ff7781ba61..1068651da5 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -206,13 +206,13 @@ _finalize (GtkObject *object)
- if (mime_part->description) g_free (mime_part->description);
- if (mime_part->disposition) gmime_content_field_unref (mime_part->disposition);
- if (mime_part->content_id) g_free (mime_part->content_id);
- if (mime_part->content_MD5) g_free (mime_part->content_MD5);
- if (mime_part->content_languages) string_list_free (mime_part->content_languages);
- if (mime_part->encoding) g_free (mime_part->encoding);
- if (mime_part->filename) g_free (mime_part->filename);
+ g_free (mime_part->description);
+ gmime_content_field_unref (mime_part->disposition);
+ g_free (mime_part->content_id);
+ g_free (mime_part->content_MD5);
+ string_list_free (mime_part->content_languages);
+ g_free (mime_part->encoding);
+ g_free (mime_part->filename);
if (mime_part->header_lines) string_list_free (mime_part->header_lines);
if (mime_part->content_type) gmime_content_field_unref (mime_part->content_type);
@@ -248,7 +248,7 @@ _add_header (CamelMedium *medium, gchar *header_name, gchar *header_value)
static void
_set_description (CamelMimePart *mime_part, const gchar *description)
{
- if (mime_part->description) g_free (mime_part->description);
+ g_free (mime_part->description);
mime_part->description = g_strdup (description);
}
@@ -285,10 +285,11 @@ static void
_set_disposition (CamelMimePart *mime_part, const gchar *disposition)
{
#warning Do not use MimeContentfield here !!!
- if (mime_part->disposition) g_free(mime_part->disposition);
- if (!mime_part->disposition)
- mime_part->disposition = g_new0 (GMimeContentField,1);
- if ((mime_part->disposition)->type) g_free ((mime_part->disposition)->type);
+
+ if (mime_part->disposition) g_free ((mime_part->disposition)->type);
+ g_free(mime_part->disposition);
+
+ mime_part->disposition = g_new0 (GMimeContentField,1);
(mime_part->disposition)->type = g_strdup (disposition);
}
@@ -323,7 +324,7 @@ camel_mime_part_get_disposition (CamelMimePart *mime_part)
static void
_set_filename (CamelMimePart *mime_part, gchar *filename)
{
- if (mime_part->filename) g_free(mime_part->filename);
+ g_free(mime_part->filename);
mime_part->filename = filename;
}
@@ -360,7 +361,7 @@ camel_mime_part_get_filename (CamelMimePart *mime_part)
static void
_set_content_id (CamelMimePart *mime_part, gchar *content_id)
{
- if (mime_part->content_id) g_free(mime_part->content_id);
+ g_free(mime_part->content_id);
mime_part->content_id = content_id;
}
@@ -386,7 +387,7 @@ camel_mime_part_get_content_id (CamelMimePart *mime_part)
static void
_set_content_MD5 (CamelMimePart *mime_part, gchar *content_MD5)
{
- if (mime_part->content_MD5) g_free(mime_part->content_MD5);
+ g_free(mime_part->content_MD5);
mime_part->content_MD5 = content_MD5;
}
@@ -414,7 +415,7 @@ camel_mime_part_get_content_MD5 (CamelMimePart *mime_part)
static void
_set_encoding (CamelMimePart *mime_part, gchar *encoding)
{
- if (mime_part->encoding) g_free(mime_part->encoding);
+ g_free(mime_part->encoding);
mime_part->encoding = encoding;
}