From f18fd209af016a01fd9e8a8da50c1c2f5ff84aab Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 30 Sep 2013 22:38:56 +0200 Subject: memleaks (bzr r12638) --- src/selection-chemistry.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index a3bb9fd77..2105ca99a 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2995,7 +2995,9 @@ void sp_selection_symbol(SPDocument *doc, SPObject *group) Inkscape::XML::Node *clone = xml_doc->createElement("svg:use"); clone->setAttribute("x", "0", false); clone->setAttribute("y", "0", false); - clone->setAttribute("xlink:href", g_strdup_printf("#%s", id.c_str()), false); + gchar *href_str = g_strdup_printf("#%s", id.c_str()); + clone->setAttribute("xlink:href", href_str, false); + g_free(href_str); clone->setAttribute("inkscape:transform-center-x", group->getAttribute("inkscape:transform-center-x"), false); clone->setAttribute("inkscape:transform-center-y", group->getAttribute("inkscape:transform-center-y"), false); @@ -3155,7 +3157,9 @@ sp_selection_tile(SPDesktop *desktop, bool apply) if (apply) { Inkscape::XML::Node *rect = xml_doc->createElement("svg:rect"); - rect->setAttribute("style", g_strdup_printf("stroke:none;fill:url(#%s)", pat_id)); + gchar *style_str = g_strdup_printf("stroke:none;fill:url(#%s)", pat_id); + rect->setAttribute("style", style_str); + g_free(style_str); Geom::Point min = bbox.min() * parent_transform.inverse(); Geom::Point max = bbox.max() * parent_transform.inverse(); @@ -3721,7 +3725,9 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ Inkscape::GC::release(group); } - apply_mask_to->setAttribute(attributeName, g_strdup_printf("url(#%s)", mask_id)); + gchar *value_str = g_strdup_printf("url(#%s)", mask_id); + apply_mask_to->setAttribute(attributeName, value_str); + g_free(value_str); } -- cgit v1.2.3