From ace6681609bb463e07283f0c354382ef5b6306e4 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Wed, 12 Jul 2023 17:12:53 +0200 Subject: [PATCH] test: no need to rewind freshly allocated mbuf (#876) * test: no need to rewind freshly allocated mbuf * test: move buf check to after mbuf_alloc --- test/rtp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/rtp.c b/test/rtp.c index 5f37ed1b3..8846d94f4 100644 --- a/test/rtp.c +++ b/test/rtp.c @@ -636,14 +636,12 @@ int test_rtcp_twcc(void) }; struct mbuf *buf = mbuf_alloc(sizeof(packets)); + if (!buf) + return ENOMEM; struct rtcp_msg *msg = NULL; int err = 0; - if (!buf) - return ENOMEM; - - mbuf_rewind(buf); mbuf_write_mem(buf, packets, sizeof(packets)); mbuf_set_pos(buf, 0);