From 8a1a7dc62021cb83c9e725de13db3aa44fda7291 Mon Sep 17 00:00:00 2001 From: joncruz Date: Wed, 21 Jan 2009 13:44:37 +0000 Subject: [PATCH] Don't hold on to pointer returned from c_str(). Might help bug 307567 --- src/color-profile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 42650b170..d3a7b9a4d 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -265,7 +265,7 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value ) //# 3. Resolve the href according the docBase. This follows // the w3c specs. All absolute and relative issues are considered org::w3c::dom::URI cprofUri = docUri.resolve(hrefUri); - gchar* fullname = (gchar *)cprofUri.getNativePath().c_str(); + gchar* fullname = g_strdup((gchar *)cprofUri.getNativePath().c_str()); cprof->_clearProfile(); cprof->profHandle = cmsOpenProfileFromFile( fullname, "r" ); if ( cprof->profHandle ) { @@ -277,6 +277,7 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value ) #endif // DEBUG_LCMS #endif // ENABLE_LCMS + g_free(fullname); } } object->requestModified(SP_OBJECT_MODIFIED_FLAG); -- 2.30.2