mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Remove some special-casing of empty string which led to dangling pointers.
2006-04-27 Matthias Clasen <mclasen@redhat.com> * glib/gbookmarkfile.c (g_bookmark_file_set_description) (g_bookmark_file_set_title, g_bookmark_file_set_icon): Remove some special-casing of empty string which led to dangling pointers. (#339337, Morten Welinder)
This commit is contained in:
parent
11f335d468
commit
6ea2f9a2c6
@ -1,3 +1,10 @@
|
|||||||
|
2006-04-27 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gbookmarkfile.c (g_bookmark_file_set_description)
|
||||||
|
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
||||||
|
Remove some special-casing of empty string which led to
|
||||||
|
dangling pointers. (#339337, Morten Welinder)
|
||||||
|
|
||||||
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
* glib/gunibreak.h, glib/gunichartables.h: Regenerated using
|
* glib/gunibreak.h, glib/gunichartables.h: Regenerated using
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2006-04-27 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* glib/gbookmarkfile.c (g_bookmark_file_set_description)
|
||||||
|
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
||||||
|
Remove some special-casing of empty string which led to
|
||||||
|
dangling pointers. (#339337, Morten Welinder)
|
||||||
|
|
||||||
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
* glib/gunibreak.h, glib/gunichartables.h: Regenerated using
|
* glib/gunibreak.h, glib/gunichartables.h: Regenerated using
|
||||||
|
@ -2126,9 +2126,7 @@ g_bookmark_file_set_title (GBookmarkFile *bookmark,
|
|||||||
if (!uri)
|
if (!uri)
|
||||||
{
|
{
|
||||||
g_free (bookmark->title);
|
g_free (bookmark->title);
|
||||||
|
bookmark->title = g_strdup (title);
|
||||||
if (title && title[0] != '\0')
|
|
||||||
bookmark->title = g_strdup (title);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2142,9 +2140,7 @@ g_bookmark_file_set_title (GBookmarkFile *bookmark,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free (item->title);
|
g_free (item->title);
|
||||||
|
item->title = g_strdup (title);
|
||||||
if (title && title[0] != '\0')
|
|
||||||
item->title = g_strdup (title);
|
|
||||||
|
|
||||||
item->modified = time (NULL);
|
item->modified = time (NULL);
|
||||||
}
|
}
|
||||||
@ -2216,10 +2212,8 @@ g_bookmark_file_set_description (GBookmarkFile *bookmark,
|
|||||||
|
|
||||||
if (!uri)
|
if (!uri)
|
||||||
{
|
{
|
||||||
g_free (bookmark->description);
|
g_free (bookmark->description);
|
||||||
|
bookmark->description = g_strdup (description);
|
||||||
if (description && description[0] != '\0')
|
|
||||||
bookmark->description = g_strdup (description);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2233,9 +2227,7 @@ g_bookmark_file_set_description (GBookmarkFile *bookmark,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free (item->description);
|
g_free (item->description);
|
||||||
|
item->description = g_strdup (description);
|
||||||
if (description && description[0] != '\0')
|
|
||||||
item->description = g_strdup (description);
|
|
||||||
|
|
||||||
item->modified = time (NULL);
|
item->modified = time (NULL);
|
||||||
}
|
}
|
||||||
@ -3590,8 +3582,7 @@ g_bookmark_file_set_icon (GBookmarkFile *bookmark,
|
|||||||
g_free (item->metadata->icon_href);
|
g_free (item->metadata->icon_href);
|
||||||
g_free (item->metadata->icon_mime);
|
g_free (item->metadata->icon_mime);
|
||||||
|
|
||||||
if (href && href[0] != '\0')
|
item->metadata->icon_href = g_strdup (href);
|
||||||
item->metadata->icon_href = g_strdup (href);
|
|
||||||
|
|
||||||
if (mime_type && mime_type[0] != '\0')
|
if (mime_type && mime_type[0] != '\0')
|
||||||
item->metadata->icon_mime = g_strdup (mime_type);
|
item->metadata->icon_mime = g_strdup (mime_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user