summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/serialisation/Serialiser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 96fe2632..cb9e36e4 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -150,8 +150,10 @@ Serialiser::finish()
_model->serialise_to_file(_base_uri);
} else {
char* c_str = _model->serialise_to_string();
- ret = c_str;
- free(c_str);
+ if (c_str != NULL) {
+ ret = c_str;
+ free(c_str);
+ }
}
_base_uri = "";