aboutsummaryrefslogtreecommitdiffstats
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
parent8d8654617655360a8c2535b1b7e1057f99f7d6ae (diff)
downloadgsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.gz
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.bz2
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.lz
gsoc2013-epiphany-ed872a964040e709a3eade1867a85b2891beb656.tar.xz
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.
-rw-r--r--ChangeLog8
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c23
2 files changed, 22 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c1cab21b7..c4e98923d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2004-08-09 Christian Persch <chpe@cvs.gnome.org>
+ * src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import):
+
+ Fix a mem leak.
+
+2004-08-09 Christian Persch <chpe@cvs.gnome.org>
+
* lib/egg/egg-toolbar-editor.c: (compare_actions):
Fix compilation with gcc 2.95.
@@ -293,7 +299,7 @@
* src/prefs-dialog.c: (prefs_download_path_button_clicked_cb):
- Start the directory choose in the home dir. Fixes bug #146055.
+ Start the directory chooser in the home dir. Fixes bug #146055.
2004-07-31 Christian Persch <chpe@cvs.gnome.org>
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 */