diff --git a/embed/ephy-base-embed.c b/embed/ephy-base-embed.c
index adb2e0a..5de330f 100644
--- a/embed/ephy-base-embed.c
+++ b/embed/ephy-base-embed.c
@@ -1001,11 +1001,10 @@ ephy_base_embed_set_address (EphyBaseEmbed *embed,
 static char*
 get_title_from_address (const char *address)
 {
-  if (g_str_has_prefix (address, "file://"))
-  {
+  if (g_str_has_prefix (address, "file://")) 
     return g_strdup (address + 7);
-  }
-  return ephy_string_get_host_name (address);
+  else
+    return ephy_string_get_host_name (address);
 }
 
 void
@@ -1057,9 +1056,8 @@ update_net_state_message (EphyBaseEmbed *embed, const char *uri, EphyEmbedNetSta
   const char *msg = NULL;
   char *host = NULL;
 
-  if (uri != NULL) {
+  if (uri != NULL)
     host = ephy_string_get_host_name (uri);
-  }
 
   if (host == NULL) goto out;
 
@@ -1406,16 +1404,14 @@ ephy_base_embed_update_file_monitor (EphyBaseEmbed *embed,
   file_type = g_file_info_get_file_type (file_info);
   g_object_unref (file_info);
 
-  if (file_type == G_FILE_TYPE_DIRECTORY)
-  {
+  if (file_type == G_FILE_TYPE_DIRECTORY) {
     monitor = g_file_monitor_directory (file, 0, NULL);
     g_signal_connect (monitor, "changed",
                       G_CALLBACK (ephy_base_embed_file_monitor_cb),
                       embed);
     LOG ("Installed monitor for directory '%s'", address);
   }
-  else if (file_type == G_FILE_TYPE_REGULAR)
-  {
+  else if (file_type == G_FILE_TYPE_REGULAR) {
     monitor = g_file_monitor_file (file, 0, NULL);
     g_signal_connect (monitor, "changed",
                       G_CALLBACK (ephy_base_embed_file_monitor_cb),
diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c
index 5140754..117c22a 100644
--- a/embed/ephy-favicon-cache.c
+++ b/embed/ephy-favicon-cache.c
@@ -424,11 +424,7 @@ delete_file (GFile *dir,
 	type = g_file_info_get_file_type (file_info);
 	mime_type = g_file_info_get_content_type (file_info);
 	
-	if (mime_type == NULL || type != G_FILE_TYPE_REGULAR)
-	{
-		return;
-	}
-	else
+	if (mime_type != NULL && type == G_FILE_TYPE_REGULAR)
 	{
 		char *path;
 		
@@ -738,6 +734,7 @@ ephy_favicon_cache_get (EphyFaviconCache *cache,
 		is_ao = strcmp (mime_type, "application/octet-stream") == 0;
 
 		g_object_unref (file_info);
+		g_object_unref (file);
 
 		/* As a special measure, we try to load an application/octet-stream file
 		 * as an ICO file, since we cannot detect a ICO file without .ico extension
@@ -873,5 +870,6 @@ ephy_favicon_cache_clear (EphyFaviconCache *cache)
 		file_info = g_file_enumerator_next_file (file_enum, NULL, NULL);
 		g_object_unref (file_info);
 	}
+	g_object_unref (dir);
 	g_file_enumerator_close (file_enum, NULL, NULL);
 }
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index b777fa9..5b7a5ac 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -253,7 +253,7 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 {
 	GtkWidget *dialog, *button, *image;
 	const char *action_label;
-	const char *mime_description;
+	char *mime_description;
 	nsCString file_name;
 			
 	nsCOMPtr<nsIDOMWindow> parentDOMWindow = do_GetInterface (mContext);
@@ -268,7 +268,7 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 	{
 		/* Translators: The text before the "|" is context to help you decide on
 		 * the correct translation. You MUST OMIT it in the translated string. */
-		mime_description = Q_("File Type:|Unknown");
+		mime_description = g_strdup (Q_("File Type:|Unknown"));
 	}
 
 	/* We have one tiny, minor issue, the filename can be empty (""),
@@ -326,6 +326,8 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 			   mime_description, file_name.get());			 
 	}
 	
+	g_free (mime_description);
+	
 	button = gtk_button_new_with_label (_("_Save As..."));
 	image = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image (GTK_BUTTON (button), image);
diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp
index fcfca09..f09a6ee 100644
--- a/embed/mozilla/EphyHeaderSniffer.cpp
+++ b/embed/mozilla/EphyHeaderSniffer.cpp
@@ -381,8 +381,7 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
 	/* FIXME: do better here by using nsITextToSubURI service, like in
 	 * http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/contentAreaUtils.js#763
 	 */
-        char *filename;
-        filename = g_uri_unescape_string (default_name, NULL);
+        char *filename = g_uri_unescape_string (default_name, NULL);
 
         if (!g_utf8_validate (filename, -1, NULL))
         {
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index aac9c8a..bdce121 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -388,6 +388,7 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
 				ephy_file_launch_application (G_APP_INFO (helperApp), list, user_time, NULL);
 
                 g_list_free (list);
+                g_object_unref (file);
 				g_strfreev (str);
 			}
 			else if (g_str_has_prefix (cDesc.get(), "gnome-browse-to-file:"))
diff --git a/embed/xulrunner/components/ContentHandler.cpp b/embed/xulrunner/components/ContentHandler.cpp
index a8a7bf9..ef8ca62 100644
--- a/embed/xulrunner/components/ContentHandler.cpp
+++ b/embed/xulrunner/components/ContentHandler.cpp
@@ -253,7 +253,7 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 {
 	GtkWidget *dialog, *button, *image;
 	const char *action_label;
-	const char *mime_description;
+	char *mime_description;
 	nsCString file_name;
 			
 	nsCOMPtr<nsIDOMWindow> parentDOMWindow = do_GetInterface (mContext);
@@ -268,7 +268,7 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 	{
 		/* Translators: The text before the "|" is context to help you decide on
 		 * the correct translation. You MUST OMIT it in the translated string. */
-		mime_description = Q_("File Type:|Unknown");
+		mime_description = g_strdup (Q_("File Type:|Unknown"));
 	}
 
 	/* We have one tiny, minor issue, the filename can be empty (""),
@@ -326,6 +326,8 @@ NS_METHOD GContentHandler::MIMEConfirmAction ()
 			   mime_description, file_name.get());			 
 	}
 	
+	g_free (mime_description);
+	
 	button = gtk_button_new_with_label (_("_Save As..."));
 	image = gtk_image_new_from_stock (GTK_STOCK_SAVE_AS, GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image (GTK_BUTTON (button), image);
diff --git a/embed/xulrunner/components/MozDownload.cpp b/embed/xulrunner/components/MozDownload.cpp
index e98f687..7b935f5 100644
--- a/embed/xulrunner/components/MozDownload.cpp
+++ b/embed/xulrunner/components/MozDownload.cpp
@@ -384,6 +384,7 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
 				ephy_file_launch_application (G_APP_INFO (helperApp), list, user_time, NULL);
 
                 g_list_free (list);
+                g_object_unref (file);
 				g_strfreev (str);
 			}
 			else if (g_str_has_prefix (cDesc.get(), "gnome-browse-to-file:"))
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 48976dc..65b74db 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -487,6 +487,7 @@ failed:
 	g_free (old_file_path);
 	g_free (file_path);
 	g_free (file_temp_path);
+	g_object_unref (old_file);
 
 	return retval;
 }
@@ -642,6 +643,7 @@ ephy_file_launch_desktop_file (const char *filename,
 	
 	ret = ephy_file_launch_application (G_APP_INFO (app), list, user_time, widget);
 	g_list_free (list);
+	g_object_unref (file);
 	return ret;
 }
 
@@ -726,6 +728,7 @@ ephy_file_browse_to (const char *parameter,
 	}
 	
 	g_free (desktop_dir);
+	g_object_unref (file);
 
 	return ret;
 }
@@ -755,4 +758,5 @@ ephy_file_delete_directory (const char *path)
 	{
 		LOG ("Couldn't delete profile dir '%s'", path);
 	}
+	g_object_unref (file);
 }
diff --git a/src/bookmarks/ephy-bookmarks-export.c b/src/bookmarks/ephy-bookmarks-export.c
index 09ea09f..c220777 100644
--- a/src/bookmarks/ephy-bookmarks-export.c
+++ b/src/bookmarks/ephy-bookmarks-export.c
@@ -430,6 +430,8 @@ out:
 		}
 	}
 
+	g_object_unref (file);
+	g_object_unref (tmp_file);
 	g_free (tmp_file_path);
 
 	STOP_PROFILER ("Exporting as RDF")
diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c
index 5599a82..44f5fd6 100644
--- a/src/bookmarks/ephy-bookmarks-import.c
+++ b/src/bookmarks/ephy-bookmarks-import.c
@@ -83,6 +83,7 @@ ephy_bookmarks_import (EphyBookmarks *bookmarks,
 				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
 				       0, NULL, NULL);
 	type = g_file_info_get_content_type (file_info);
+	g_object_unref (file_info);
 
 	g_debug ("Importing bookmarks of type %s", type ? type : "(null)");
 
@@ -131,6 +132,8 @@ ephy_bookmarks_import (EphyBookmarks *bookmarks,
 		g_free (basename);
 	}
 
+	g_object_unref (file);
+
 	return success;
 }
 
diff --git a/src/ephy-main.c b/src/ephy-main.c
index f378ce0..1374896 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -605,6 +605,7 @@ main (int argc,
 					GFile *file;
 					file = g_file_new_for_commandline_arg (uri);
 					arguments[i] = g_file_get_uri (file);
+					g_object_unref (file);
 					g_free (uri);
 				}
 				else
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 11a50de..c07bba4 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1303,6 +1303,8 @@ out:
 	}
 
 	g_free (tmp_file_path);
+	g_object_unref (save_to_file);
+	g_object_unref (tmp_file);
 
 	STOP_PROFILER ("Saving session")
 
diff --git a/src/popup-commands.c b/src/popup-commands.c
index ee1e831..51b2fbf 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -420,6 +420,7 @@ save_source_completed_cb (EphyEmbedPersist *persist)
 	file = g_file_new_for_path (dest);
 
 	image_open_uri (file, source, user_time);
+	g_object_unref (file);
 }
 
 static void
@@ -490,6 +491,7 @@ popup_cmd_open_image (GtkAction *action,
 		file = g_file_new_for_uri (address);
 		image_open_uri (file, address,
 				gtk_get_current_event_time ());
+		g_object_unref (file);
 	}
 	else
 	{
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 92ad057..8cc8450 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -655,6 +655,7 @@ css_edit_button_clicked_cb (GtkWidget *button,
 
 	ephy_file_launch_handler ("text/plain", css_file,
 				  gtk_get_current_event_time ());
+	g_object_unref (css_file);
 }
 
 static void
diff --git a/src/window-commands.c b/src/window-commands.c
index bf15966..9bc698a 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -587,6 +587,7 @@ save_source_completed_cb (EphyEmbedPersist *persist)
 	ephy_file_delete_on_exit (file);
 
 	ephy_file_launch_handler ("text/plain", file, user_time);
+	g_object_unref (file);
 }
 
 static void
@@ -650,6 +651,8 @@ window_cmd_view_page_source (GtkAction *action,
 		
 		file = g_file_new_for_uri (address);
 		ephy_file_launch_handler ("text/plain", file, user_time);
+		
+		g_object_unref (file);
 	}
 	else
 	{
