aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-01-13 23:38:33 +0800
committerDiego Escalante Urrelo <diegoe@gnome.org>2010-01-21 22:11:56 +0800
commitb057a59f9aa6f8568b2416172f27034ef4507f22 (patch)
tree6483f948afa79ce6e7fc9c64cd17f471ff3561d2 /embed
parentf007602b631fee9ac23c909abb75bd606f501a4f (diff)
downloadgsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar.gz
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar.bz2
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar.lz
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar.xz
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.tar.zst
gsoc2013-epiphany-b057a59f9aa6f8568b2416172f27034ef4507f22.zip
ephy-web-view: plug leaks in ephy_web_view_save
Bug #606876
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-web-view.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 27eddbac0..36d13da0c 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);