summaryrefslogtreecommitdiffstats
path: root/src/io/uristream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/uristream.cpp')
-rw-r--r--src/io/uristream.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp
index ff4cca74d..9fd0d9c96 100644
--- a/src/io/uristream.cpp
+++ b/src/io/uristream.cpp
@@ -321,11 +321,14 @@ UriOutputStream::UriOutputStream(Inkscape::URI &destination)
//printf("out path:'%s'\n", cpath);
outf = fopen_utf8name(cpath, FILE_WRITE);
//outf = fopen(cpath, "wb");
- g_free(cpath);
+
if (!outf) {
Glib::ustring err = "UriOutputStream cannot open file ";
err += cpath;
+ g_free(cpath);
throw StreamException(err);
+ } else {
+ g_free(cpath);
}
break;