From 0b3a91c8ff18bd30b42beb71244ff9b0542ed2ca Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 28 Sep 2013 21:58:24 +0200 Subject: fix two memleaks (bzr r12617) --- src/ui/dialog/svg-fonts-dialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index ab5f4c0e9..56ecfdecc 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -541,7 +541,9 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d")); //XML Tree being directly used here while it shouldn't be. - glyph->getRepr()->setAttribute("d", (char*) sp_svg_write_path (flip_coordinate_system(pathv))); + gchar *str = sp_svg_write_path (flip_coordinate_system(pathv)); + glyph->getRepr()->setAttribute("d", str); + g_free(str); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); update_glyphs(); @@ -578,7 +580,9 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){ if (SP_IS_MISSING_GLYPH(obj)){ //XML Tree being directly used here while it shouldn't be. - obj->getRepr()->setAttribute("d", (char*) sp_svg_write_path (flip_coordinate_system(pathv))); + gchar *str = sp_svg_write_path (flip_coordinate_system(pathv)); + obj->getRepr()->setAttribute("d", str); + g_free(str); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); } } -- cgit v1.2.3