diff --git a/src/testing/streams.c b/src/testing/streams.c index d718ab76b..33c70c008 100644 --- a/src/testing/streams.c +++ b/src/testing/streams.c @@ -80,7 +80,7 @@ stream_xfr_alloc(nng_stream *s, void (*submit)(nng_stream *, nng_aio *), { stream_xfr_t *x; - if ((x = nng_alloc(size)) == NULL) { + if ((x = nng_alloc(sizeof(*x))) == NULL) { return (NULL); } if (nng_aio_alloc(&x->upper_aio, NULL, NULL) != 0) {