summaryrefslogtreecommitdiffstats
path: root/src/uri-references.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-01-26 17:19:47 +0000
committerMartin Owens <doctormo@gmail.com>2014-01-26 17:19:47 +0000
commit7455f1a259ce28ee56866b5cde06e79be4cfaf97 (patch)
tree5c10c6096fac9f5ff169abbc32133bc3b3dc1094 /src/uri-references.cpp
parentA partial refactor of sp-image.cpp, expect more. (diff)
downloadinkscape-7455f1a259ce28ee56866b5cde06e79be4cfaf97.tar.gz
inkscape-7455f1a259ce28ee56866b5cde06e79be4cfaf97.zip
Check file existance and clean up memory issues thanks to KK and Johan
(bzr r12979)
Diffstat (limited to 'src/uri-references.cpp')
-rw-r--r--src/uri-references.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp
index dc0101024..abe16ec9d 100644
--- a/src/uri-references.cpp
+++ b/src/uri-references.cpp
@@ -58,10 +58,12 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
// The path contains references to seperate document files to load.
if(document && uri.getPath()) {
- std::string base = std::string(g_strdup(document->getBase()));
+ std::string base = std::string(document->getBase());
std::string path = uri.getFullPath(base);
if(!path.empty())
document = document->createChildDoc(path);
+ else
+ document = NULL;
}
if(!document) {
g_warning("Can't get document for referenced URI: %s", uri.toString());