aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vasin <rat4vier@gmail.com>2012-06-12 00:06:38 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-06-12 17:30:51 +0800
commit4c23170684f95f4209c5245c1a4663ebc894f676 (patch)
tree0f7acece0da1b52356db60952087f5c73f85dfea
parenta05676a3259e266aa9da842e1059d5df0b177619 (diff)
downloadgsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar.gz
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar.bz2
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar.lz
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar.xz
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.tar.zst
gsoc2013-epiphany-4c23170684f95f4209c5245c1a4663ebc894f676.zip
ephy-session: fix memory leak in write_tab()
https://bugzilla.gnome.org/show_bug.cgi?id=677720
-rw-r--r--src/ephy-session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index d06a766cf..7a4ebbce0 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));