Commit 3916fe18 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Remove redundant code. (g_key_file_get_group_comment): Don't dereference

2006-04-25  Matthias Clasen  <mclasen@redhat.com>

	* glib/gkeyfile.c (g_key_file_lookup_group_node): Remove
	redundant code.
	(g_key_file_get_group_comment): Don't dereference before
	checking for NULL.  (#338572, Coverity, Pascal Terjan)
parent 5dd378d2
2006-04-25 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c (g_key_file_lookup_group_node): Remove
redundant code.
(g_key_file_get_group_comment): Don't dereference before
checking for NULL. (#338572, Coverity, Pascal Terjan)
2006-04-19 Matthias Clasen <mclasen@redhat.com>
* glib/gdataset.c: Add some missing Since: 2.8 tags.
......
2006-04-25 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c (g_key_file_lookup_group_node): Remove
redundant code.
(g_key_file_get_group_comment): Don't dereference before
checking for NULL. (#338572, Coverity, Pascal Terjan)
2006-04-19 Matthias Clasen <mclasen@redhat.com>
* glib/gdataset.c: Add some missing Since: 2.8 tags.
......
......@@ -2699,8 +2699,7 @@ g_key_file_get_group_comment (GKeyFile *key_file,
GKeyFileGroup *group;
group_node = g_key_file_lookup_group_node (key_file, group_name);
group = (GKeyFileGroup *)group_node->data;
if (!group)
if (!group_node)
{
g_set_error (error, G_KEY_FILE_ERROR,
G_KEY_FILE_ERROR_GROUP_NOT_FOUND,
......@@ -2710,6 +2709,7 @@ g_key_file_get_group_comment (GKeyFile *key_file,
return NULL;
}
group = (GKeyFileGroup *)group_node->data;
if (group->comment)
return g_strdup (group->comment->value);
......@@ -3119,15 +3119,12 @@ g_key_file_lookup_group_node (GKeyFile *key_file,
GKeyFileGroup *group;
GList *tmp;
group = NULL;
for (tmp = key_file->groups; tmp != NULL; tmp = tmp->next)
{
group = (GKeyFileGroup *) tmp->data;
if (group && group->name && strcmp (group->name, group_name) == 0)
break;
group = NULL;
}
return tmp;
......
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