aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/serdi.c')
-rw-r--r--src/serdi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/serdi.c b/src/serdi.c
index 2054470e..9332519b 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -252,15 +252,19 @@ main(int argc, char** argv)
}
serd_reader_free(reader);
+ serd_writer_finish(writer);
+ serd_writer_free(writer);
+ serd_env_free(env);
+ serd_node_free(&base);
if (from_file) {
fclose(in_fd);
}
- serd_writer_finish(writer);
- serd_writer_free(writer);
- serd_env_free(env);
- serd_node_free(&base);
+ if (fclose(out_fd)) {
+ perror("serdi: write error");
+ status = SERD_ERR_UNKNOWN;
+ }
return (status > SERD_FAILURE) ? 1 : 0;
}