Commit 0b11148f authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Remove redundant NULL checks

svn path=/trunk/; revision=5264
parent a74d6b95
2005-01-15 Matthias Clasen <mclasen@redhat.com>
* glib/giochannel.c:
* glib/gbookmarkfile.c: Remove redundant NULL-checks.
(#369668, Morten Welinder)
2005-01-15 Matthias Clasen <mclasen@redhat.com>
* glib/gthread.c:
......
......@@ -237,11 +237,8 @@ bookmark_app_info_free (BookmarkAppInfo *app_info)
if (!app_info)
return;
if (app_info->name)
g_free (app_info->name);
if (app_info->exec)
g_free (app_info->exec);
g_free (app_info->name);
g_free (app_info->exec);
g_slice_free (BookmarkAppInfo, app_info);
}
......@@ -311,8 +308,7 @@ bookmark_metadata_free (BookmarkMetadata *metadata)
if (!metadata)
return;
if (metadata->mime_type)
g_free (metadata->mime_type);
g_free (metadata->mime_type);
if (metadata->groups)
{
......@@ -332,11 +328,8 @@ bookmark_metadata_free (BookmarkMetadata *metadata)
g_hash_table_destroy (metadata->apps_by_name);
}
if (metadata->icon_href)
g_free (metadata->icon_href);
if (metadata->icon_mime)
g_free (metadata->icon_mime);
g_free (metadata->icon_href);
g_free (metadata->icon_mime);
g_slice_free (BookmarkMetadata, metadata);
}
......@@ -491,14 +484,9 @@ bookmark_item_free (BookmarkItem *item)
if (!item)
return;
if (item->uri)
g_free (item->uri);
if (item->title)
g_free (item->title);
if (item->description)
g_free (item->description);
g_free (item->uri);
g_free (item->title);
g_free (item->description);
if (item->metadata)
bookmark_metadata_free (item->metadata);
......@@ -2319,8 +2307,7 @@ g_bookmark_file_set_mime_type (GBookmarkFile *bookmark,
if (!item->metadata)
item->metadata = bookmark_metadata_new ();
if (item->metadata->mime_type != NULL)
g_free (item->metadata->mime_type);
g_free (item->metadata->mime_type);
item->metadata->mime_type = g_strdup (mime_type);
item->modified = time (NULL);
......
......@@ -122,8 +122,7 @@ g_io_channel_unref (GIOChannel *channel)
g_iconv_close (channel->read_cd);
if (channel->write_cd != (GIConv) -1)
g_iconv_close (channel->write_cd);
if (channel->line_term)
g_free (channel->line_term);
g_free (channel->line_term);
if (channel->read_buf)
g_string_free (channel->read_buf, TRUE);
if (channel->write_buf)
......@@ -691,8 +690,7 @@ g_io_channel_set_line_term (GIOChannel *channel,
else if (length < 0)
length = strlen (line_term);
if (channel->line_term)
g_free (channel->line_term);
g_free (channel->line_term);
channel->line_term = line_term ? g_memdup (line_term, length) : NULL;
channel->line_term_len = length;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment