[epiphany] ephy-session: fix memory leak in write_tab()
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-session: fix memory leak in write_tab()
- Date: Tue, 12 Jun 2012 09:31:59 +0000 (UTC)
commit 4c23170684f95f4209c5245c1a4663ebc894f676
Author: Pavel Vasin <rat4vier gmail com>
Date: Mon Jun 11 20:06:38 2012 +0400
ephy-session: fix memory leak in write_tab()
https://bugzilla.gnome.org/show_bug.cgi?id=677720
src/ephy-session.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index d06a766..7a4ebbc 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -650,6 +650,7 @@ write_tab (xmlTextWriterPtr writer,
EphyEmbed *embed)
{
const char *address, *title;
+ char *new_address = NULL;
int ret;
ret = xmlTextWriterStartElement (writer, (xmlChar *) "embed");
@@ -660,10 +661,11 @@ write_tab (xmlTextWriterPtr writer,
* loading. */
if (g_str_has_prefix (address, EPHY_ABOUT_SCHEME))
{
- address = g_strconcat ("about", address + EPHY_ABOUT_SCHEME_LEN, NULL);
+ new_address = g_strconcat ("about", address + EPHY_ABOUT_SCHEME_LEN, NULL);
}
ret = xmlTextWriterWriteAttribute (writer, (xmlChar *) "url",
- (const xmlChar *) address);
+ (const xmlChar *) (new_address ? new_address : address));
+ g_free (new_address);
if (ret < 0) return ret;
title = ephy_web_view_get_title (ephy_embed_get_web_view (embed));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]