Plug leaks and don't set name in JSON import
This commit is contained in:
parent
1e5e1710ee
commit
706fc6d063
1 changed files with 3 additions and 4 deletions
|
@ -1525,7 +1525,6 @@ speeddial_new_from_file (const gchar* config,
|
||||||
}
|
}
|
||||||
else if (g_str_equal (key, "href") && (*val && strncmp (val, "#", 1)))
|
else if (g_str_equal (key, "href") && (*val && strncmp (val, "#", 1)))
|
||||||
{
|
{
|
||||||
g_key_file_set_value (key_file, dial_id, "name", slot);
|
|
||||||
g_key_file_set_value (key_file, dial_id, "uri", val);
|
g_key_file_set_value (key_file, dial_id, "uri", val);
|
||||||
}
|
}
|
||||||
else if (g_str_equal (key, "img") && *val)
|
else if (g_str_equal (key, "img") && *val)
|
||||||
|
@ -1555,9 +1554,10 @@ speeddial_new_from_file (const gchar* config,
|
||||||
{
|
{
|
||||||
guint thumb_size;
|
guint thumb_size;
|
||||||
gchar* thumb_size_type;
|
gchar* thumb_size_type;
|
||||||
|
gchar* size_tmp = g_strndup (val + 1, strlen (val) - 3);
|
||||||
|
|
||||||
/* FIXME: leaked string */
|
thumb_size = atoi (size_tmp);
|
||||||
thumb_size = atoi (g_strndup (val + 1, strlen (val) - 3));
|
g_free (size_tmp);
|
||||||
if (thumb_size == 80)
|
if (thumb_size == 80)
|
||||||
thumb_size_type = g_strdup ("SMALL");
|
thumb_size_type = g_strdup ("SMALL");
|
||||||
else if (thumb_size == 240)
|
else if (thumb_size == 240)
|
||||||
|
@ -1570,7 +1570,6 @@ speeddial_new_from_file (const gchar* config,
|
||||||
}
|
}
|
||||||
else if (g_str_equal (key, "title") && *val)
|
else if (g_str_equal (key, "title") && *val)
|
||||||
{
|
{
|
||||||
g_key_file_set_value (key_file, dial_id, "name", slot);
|
|
||||||
g_key_file_set_value (key_file, dial_id, key, val + 3);
|
g_key_file_set_value (key_file, dial_id, key, val + 3);
|
||||||
}
|
}
|
||||||
else if (g_str_equal (key, "width"))
|
else if (g_str_equal (key, "width"))
|
||||||
|
|
Loading…
Reference in a new issue