[epiphany] ephy-web-view: plug leaks in ephy_web_view_save
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-web-view: plug leaks in ephy_web_view_save
- Date: Thu, 21 Jan 2010 14:18:23 +0000 (UTC)
commit b057a59f9aa6f8568b2416172f27034ef4507f22
Author: Diego Escalante Urrelo <descalante igalia com>
Date: Wed Jan 13 10:38:33 2010 -0500
ephy-web-view: plug leaks in ephy_web_view_save
Bug #606876
embed/ephy-web-view.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 27eddba..36d13da 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -3344,21 +3344,23 @@ ephy_web_view_save_sub_resource_start (GList *subresources, char *destination_ur
{
WebKitWebResource *resource;
GFile *file;
- char *resource_uri;
+ const char *resource_uri;
char *resource_name;
+ char *resource_dest_uri;
const GString *data;
resource = WEBKIT_WEB_RESOURCE (subresources->data);
- resource_uri = (char*)webkit_web_resource_get_uri (resource);
+ resource_uri = webkit_web_resource_get_uri (resource);
resource_name = g_path_get_basename (resource_uri);
- resource_uri = g_strdup_printf ("%s/%s",
+ resource_dest_uri = g_strdup_printf ("%s/%s",
destination_uri,
resource_name);
+ g_free (resource_name);
- file = g_file_new_for_uri (resource_uri);
- g_free (resource_uri);
+ file = g_file_new_for_uri (resource_dest_uri);
+ g_free (resource_dest_uri);
g_object_set_data (G_OBJECT (file),
"ephy-web-view-save-dest-uri",
@@ -3402,13 +3404,14 @@ ephy_web_view_save_sub_resources (EphyWebView *view, const char *uri, GList *sub
* when saving html files.
*/
tmp = g_strdup_printf (_("%s Files"), filename);
- destination_uri = g_strdup_printf ("%s/%s", directory_uri, tmp);
- g_free (tmp);
-
g_free (filename);
+
+ destination_uri = g_strdup_printf ("%s/%s", directory_uri, tmp);
g_free (directory_uri);
+ g_free (tmp);
file = g_file_new_for_uri (destination_uri);
+
if (!g_file_make_directory (file, NULL, &error)) {
if (error->code != G_IO_ERROR_EXISTS) {
g_warning ("Could not create directory: %s", error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]