From c94100093bbd8a68b6da68e75a41600524d66757 Mon Sep 17 00:00:00 2001 From: David Mathog Date: Sun, 9 Feb 2014 12:08:00 +0100 Subject: memleak fix (bzr r13013) --- src/desktop-style.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 00b9db7d0..bab9635a9 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -587,11 +587,15 @@ objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill paint_res->colorSet = paint->colorSet; paint_res->currentcolor = paint->currentcolor; if (paint_res->set && paint_effectively_set && paint->isPaintserver()) { // copy the server + gchar const *string = NULL; // memory leak results if style->get* called inside sp_style_set_to_uri_string. if (isfill) { - sp_style_set_to_uri_string (style_res, true, style->getFillURI()); + string = style->getFillURI(); + sp_style_set_to_uri_string (style_res, true, string); } else { - sp_style_set_to_uri_string (style_res, false, style->getStrokeURI()); + string = style->getStrokeURI(); + sp_style_set_to_uri_string (style_res, false, string); } + if(string)g_free((void *) string); } paint_res->set = paint_effectively_set; style_res->fill_rule.computed = style->fill_rule.computed; // no averaging on this, just use the last one -- cgit v1.2.3