From 35f10ad3610bb3e678524dd422ca46b5f67b160a Mon Sep 17 00:00:00 2001 From: johanengelen Date: Tue, 3 Mar 2009 20:08:37 +0000 Subject: [PATCH] minor code cleanup --- src/filters/image.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/filters/image.cpp b/src/filters/image.cpp index f4764577a..32afe5db6 100644 --- a/src/filters/image.cpp +++ b/src/filters/image.cpp @@ -140,12 +140,14 @@ sp_feImage_set(SPObject *object, unsigned int key, gchar const *value) { SPFeImage *feImage = SP_FEIMAGE(object); (void)feImage; - Inkscape::URI* SVGElem_uri; + Inkscape::URI *SVGElem_uri = NULL; switch(key) { - /*DEAL WITH SETTING ATTRIBUTES HERE*/ - case SP_ATTR_XLINK_HREF: - if (feImage->href) g_free(feImage->href); - feImage->href = (value) ? g_strdup (value) : NULL; + /*DEAL WITH SETTING ATTRIBUTES HERE*/ + case SP_ATTR_XLINK_HREF: + if (feImage->href) { + g_free(feImage->href); + } + feImage->href = (value) ? g_strdup (value) : NULL; if (!feImage->href) return; try{ SVGElem_uri = new Inkscape::URI(feImage->href); @@ -153,8 +155,8 @@ sp_feImage_set(SPObject *object, unsigned int key, gchar const *value) feImage->from_element = true; feImage->SVGElemRef->attach(*SVGElem_uri); feImage->SVGElem = SP_ITEM(feImage->SVGElemRef->getObject()); - - g_free(SVGElem_uri); + + delete SVGElem_uri; feImage->_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object)); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; -- 2.30.2