From c3d8e75f2bb76b5bfafc589f860036cf42cfbaa0 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 2 Jan 2017 11:26:43 -0800 Subject: Use new NNI_ALLOC_STRUCT macro. nni_msg_dup copies options too. --- src/core/msgqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/msgqueue.c') diff --git a/src/core/msgqueue.c b/src/core/msgqueue.c index ba6aa6bb..4807fe0f 100644 --- a/src/core/msgqueue.c +++ b/src/core/msgqueue.c @@ -48,7 +48,7 @@ nni_msgqueue_create(nni_msgqueue **mqp, int cap) // a message back at the end to do a retry. alloc = cap + 2; - if ((mq = nni_alloc(sizeof (*mq))) == NULL) { + if ((mq = NNI_ALLOC_STRUCT(mq)) == NULL) { return (NNG_ENOMEM); } if ((rv = nni_mtx_init(&mq->mq_lock)) != 0) { @@ -113,7 +113,7 @@ nni_msgqueue_destroy(nni_msgqueue *mq) } nni_free(mq->mq_msgs, mq->mq_alloc * sizeof (nng_msg *)); - nni_free(mq, sizeof (*mq)); + NNI_FREE_STRUCT(mq); } -- cgit v1.2.3-70-g09d2