aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-06-13 12:42:31 -0400
committerDavid Robillard <d@drobilla.net>2016-06-13 12:42:31 -0400
commitc7715b8b5ee48297c9a4fc0831556921d5f78fb0 (patch)
tree461990ee9bc37f87588ed6c46682fee49b86cbeb /src/writer.c
parent8f7cac4752d427f833969d316542d7a82b4602ea (diff)
downloadserd-c7715b8b5ee48297c9a4fc0831556921d5f78fb0.tar.gz
serd-c7715b8b5ee48297c9a4fc0831556921d5f78fb0.tar.bz2
serd-c7715b8b5ee48297c9a4fc0831556921d5f78fb0.zip
Fix use of uninitialized fields
Fixes #1135
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/writer.c b/src/writer.c
index a037bf81..954b9b5c 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -799,7 +799,7 @@ serd_writer_new(SerdSyntax syntax,
void* stream)
{
const WriteContext context = WRITE_CONTEXT_NULL;
- SerdWriter* writer = (SerdWriter*)malloc(sizeof(SerdWriter));
+ SerdWriter* writer = (SerdWriter*)calloc(1, sizeof(SerdWriter));
writer->syntax = syntax;
writer->style = style;
writer->env = env;
@@ -809,15 +809,8 @@ serd_writer_new(SerdSyntax syntax,
writer->anon_stack = serd_stack_new(sizeof(WriteContext));
writer->sink = ssink;
writer->stream = stream;
- writer->error_sink = NULL;
- writer->error_handle = NULL;
writer->context = context;
writer->list_subj = SERD_NODE_NULL;
- writer->list_depth = 0;
- writer->bprefix = NULL;
- writer->bprefix_len = 0;
- writer->indent = 0;
- writer->last_sep = SEP_NONE;
writer->empty = true;
if (style & SERD_STYLE_BULK) {
writer->bulk_sink = serd_bulk_sink_new(ssink, stream, SERD_PAGE_SIZE);