diff options
Diffstat (limited to 'lib/stream.c')
-rw-r--r-- | lib/stream.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/stream.c b/lib/stream.c index a172eedc9..cf9af4d3b 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -100,16 +100,12 @@ struct stream *stream_new(size_t size) assert(size > 0); - s = XCALLOC(MTYPE_STREAM, sizeof(struct stream)); + s = XMALLOC(MTYPE_STREAM, sizeof(struct stream)); - if (s == NULL) - return s; - - if ((s->data = XMALLOC(MTYPE_STREAM_DATA, size)) == NULL) { - XFREE(MTYPE_STREAM, s); - return NULL; - } + s->data = XMALLOC(MTYPE_STREAM_DATA, size); + s->getp = s->endp = 0; + s->next = NULL; s->size = size; return s; } |