aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-02-27 22:44:27 +0800
committerChristian Persch <chpe@src.gnome.org>2004-02-27 22:44:27 +0800
commit9f59023c308b583478e4519cf8d08419db4361b0 (patch)
tree371a369d7d35a44fedfd5d7f3a5513154ffbc2a6 /src
parent05f52f8139eb2c0b7ee0a1610422c6cede3ece44 (diff)
downloadgsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar.gz
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar.bz2
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar.lz
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar.xz
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.tar.zst
gsoc2013-epiphany-9f59023c308b583478e4519cf8d08419db4361b0.zip
Fix potential crash.
2004-02-27 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmarks-import.c: (ns_parse_bookmark_item): Fix potential crash. (ephy_bookmarks_import_mozilla): Fix mem leak.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index 01a7feb24..0b0eecfa1 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -490,6 +490,8 @@ ns_get_bookmark_item (FILE *f, GString *name, GString *url)
* More info : http://www.w3.org/TR/html4/charset.html#h-5.3.2
* NOTE : We don't support &#D or &#xH.
* Patch courtesy of Almer S. Tigelaar <almer1@dds.nl>
+ *
+ * NOTE: The returned string must be freed.
*/
static char *
ns_parse_bookmark_item (GString *string)
@@ -557,7 +559,7 @@ ns_parse_bookmark_item (GString *string)
for (i = jump - 1; i > 0; i--)
{
iterator++;
- if (iterator == NULL)
+ if (*iterator == '\0')
break;
}
}
@@ -577,7 +579,7 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks,
{
FILE *bf; /* bookmark file */
GString *name;
- gchar *parsedname;
+ char *parsedname;
GString *url = g_string_new (NULL);
GList *folders = NULL, *l;
@@ -636,6 +638,9 @@ ephy_bookmarks_import_mozilla (EphyBookmarks *bookmarks,
ephy_bookmarks_set_keyword (bookmarks, keyword, node);
}
}
+
+ g_free (parsedname);
+
break;
default:
break;