aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/env.c4
-rw-r--r--src/reader.c4
-rw-r--r--src/writer.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/env.c b/src/env.c
index e5cb954a..e67b42c0 100644
--- a/src/env.c
+++ b/src/env.c
@@ -47,6 +47,10 @@ serd_env_new(const SerdNode* base_uri)
void
serd_env_free(SerdEnv* env)
{
+ if (!env) {
+ return;
+ }
+
for (size_t i = 0; i < env->n_prefixes; ++i) {
serd_node_free(&env->prefixes[i].name);
serd_node_free(&env->prefixes[i].uri);
diff --git a/src/reader.c b/src/reader.c
index 4710caac..5d33e45d 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -218,6 +218,10 @@ serd_reader_set_error_sink(SerdReader* reader,
void
serd_reader_free(SerdReader* reader)
{
+ if (!reader) {
+ return;
+ }
+
pop_node(reader, reader->rdf_nil);
pop_node(reader, reader->rdf_rest);
pop_node(reader, reader->rdf_first);
diff --git a/src/writer.c b/src/writer.c
index 81e0a845..5f312c30 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -978,6 +978,10 @@ serd_writer_set_prefix(SerdWriter* writer,
void
serd_writer_free(SerdWriter* writer)
{
+ if (!writer) {
+ return;
+ }
+
serd_writer_finish(writer);
serd_stack_free(&writer->anon_stack);
free(writer->bprefix);