summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/extension/system.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index 34855cd4e..ccf168446 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -437,8 +437,9 @@ build_from_file(gchar const *filename)
DTD in general for this stuff */
Inkscape::XML::Document *doc = sp_repr_read_file(filename, NULL);
Extension *ext = build_from_reprdoc(doc, NULL);
- Inkscape::GC::release(doc);
- if (ext == NULL)
+ if (ext != NULL)
+ Inkscape::GC::release(doc);
+ else
g_warning("Unable to create extension from definition file %s.\n", filename);
return ext;
}