diff options
author | David Robillard <d@drobilla.net> | 2016-05-29 18:34:09 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-05-29 18:34:09 -0400 |
commit | 8f7cac4752d427f833969d316542d7a82b4602ea (patch) | |
tree | 27dcc29cbca11aee2127ddcdc71a246fbed077e9 /src/serdi.c | |
parent | 78e55b937ce347eef6387499ddd91d06d73e3a7c (diff) | |
download | serd-8f7cac4752d427f833969d316542d7a82b4602ea.tar.gz serd-8f7cac4752d427f833969d316542d7a82b4602ea.tar.bz2 serd-8f7cac4752d427f833969d316542d7a82b4602ea.zip |
Fix handling of file I/O errors
Diffstat (limited to 'src/serdi.c')
-rw-r--r-- | src/serdi.c | 12 |
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; } |