mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-25 16:46:52 +02:00
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)
This commit is contained in:
parent
5dd378d2bd
commit
3916fe18d6
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2006-04-19 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gdataset.c: Add some missing Since: 2.8 tags.
|
* glib/gdataset.c: Add some missing Since: 2.8 tags.
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2006-04-19 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gdataset.c: Add some missing Since: 2.8 tags.
|
* 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;
|
GKeyFileGroup *group;
|
||||||
|
|
||||||
group_node = g_key_file_lookup_group_node (key_file, group_name);
|
group_node = g_key_file_lookup_group_node (key_file, group_name);
|
||||||
group = (GKeyFileGroup *)group_node->data;
|
if (!group_node)
|
||||||
if (!group)
|
|
||||||
{
|
{
|
||||||
g_set_error (error, G_KEY_FILE_ERROR,
|
g_set_error (error, G_KEY_FILE_ERROR,
|
||||||
G_KEY_FILE_ERROR_GROUP_NOT_FOUND,
|
G_KEY_FILE_ERROR_GROUP_NOT_FOUND,
|
||||||
@ -2710,6 +2709,7 @@ g_key_file_get_group_comment (GKeyFile *key_file,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group = (GKeyFileGroup *)group_node->data;
|
||||||
if (group->comment)
|
if (group->comment)
|
||||||
return g_strdup (group->comment->value);
|
return g_strdup (group->comment->value);
|
||||||
|
|
||||||
@ -3119,15 +3119,12 @@ g_key_file_lookup_group_node (GKeyFile *key_file,
|
|||||||
GKeyFileGroup *group;
|
GKeyFileGroup *group;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
group = NULL;
|
|
||||||
for (tmp = key_file->groups; tmp != NULL; tmp = tmp->next)
|
for (tmp = key_file->groups; tmp != NULL; tmp = tmp->next)
|
||||||
{
|
{
|
||||||
group = (GKeyFileGroup *) tmp->data;
|
group = (GKeyFileGroup *) tmp->data;
|
||||||
|
|
||||||
if (group && group->name && strcmp (group->name, group_name) == 0)
|
if (group && group->name && strcmp (group->name, group_name) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
group = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user