diff --git a/lib/stream.c b/lib/stream.c index a172eedc99..cf9af4d3bb 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; }