aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-08-09 23:19:39 +0800
committerChristian Persch <chpe@src.gnome.org>2004-08-09 23:19:39 +0800
commited872a964040e709a3eade1867a85b2891beb656 (patch)
tree5c4030bdb0cb91d78e36231852665a76660fd8b6 /src/bookmarks
parent8d8654617655360a8c2535b1b7e1057f99f7d6ae (diff)
downloadgsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.gz
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.zst
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.zip
Fix a mem leak.
2004-08-09 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import): Fix a mem leak.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index eed3774cf..9d5b0b19a 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -71,6 +71,7 @@ ephy_bookmarks_import (EphyBookmarks *bookmarks,
{
GnomeVFSURI *uri;
const char *type;
+ gboolean success = FALSE;
if (eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING)) return FALSE;
@@ -79,35 +80,41 @@ ephy_bookmarks_import (EphyBookmarks *bookmarks,
LOG ("Importing bookmarks of type %s", type)
- if (type == NULL) return FALSE;
+ if (type == NULL)
+ {
+ gnome_vfs_uri_unref (uri);
+ return FALSE;
+ }
if (strcmp (type, "application/x-mozilla-bookmarks") == 0)
{
- return ephy_bookmarks_import_mozilla (bookmarks, filename);
+ success = ephy_bookmarks_import_mozilla (bookmarks, filename);
}
else if (strcmp (type, "application/x-xbel") == 0)
{
- return ephy_bookmarks_import_xbel (bookmarks, filename);
+ success = ephy_bookmarks_import_xbel (bookmarks, filename);
}
- else if (strcmp (type, "text/rdf") == 0)
+ else if (strcmp (type, "application/rdf+xml") == 0 ||
+ strcmp (type, "text/rdf") == 0)
{
- return ephy_bookmarks_import_rdf (bookmarks, filename);
+ success = ephy_bookmarks_import_rdf (bookmarks, filename);
}
else if (strstr (filename, MOZILLA_BOOKMARKS_DIR) != NULL ||
strstr (filename, FIREBIRD_BOOKMARKS_DIR) != NULL ||
strstr (filename, FIREFOX_BOOKMARKS_DIR) != NULL)
{
- return ephy_bookmarks_import_mozilla (bookmarks, filename);
+ success = ephy_bookmarks_import_mozilla (bookmarks, filename);
}
else if (strstr (filename, GALEON_BOOKMARKS_DIR) != NULL ||
strstr (filename, KDE_BOOKMARKS_DIR) != NULL)
{
- return ephy_bookmarks_import_xbel (bookmarks, filename);
+ success = ephy_bookmarks_import_xbel (bookmarks, filename);
}
+ /* else FIXME: put up some UI to warn user about unrecognised format? */
gnome_vfs_uri_unref (uri);
- return FALSE;
+ return success;
}
/* XBEL import */