From aee24f70bc5fb9dd2f31628ed4c2ca17920e5c01 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Wed, 12 Jul 2023 10:42:20 +0200 Subject: [PATCH 1/2] test: no need to rewind freshly allocated mbuf --- test/rtp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/rtp.c b/test/rtp.c index 5f37ed1b3..146fdab7e 100644 --- a/test/rtp.c +++ b/test/rtp.c @@ -643,7 +643,6 @@ int test_rtcp_twcc(void) if (!buf) return ENOMEM; - mbuf_rewind(buf); mbuf_write_mem(buf, packets, sizeof(packets)); mbuf_set_pos(buf, 0); From eab8f551d3ca57655889f07556effc795ec07c08 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Wed, 12 Jul 2023 17:04:12 +0200 Subject: [PATCH 2/2] test: move buf check to after mbuf_alloc --- test/rtp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/rtp.c b/test/rtp.c index 146fdab7e..8846d94f4 100644 --- a/test/rtp.c +++ b/test/rtp.c @@ -636,13 +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_write_mem(buf, packets, sizeof(packets)); mbuf_set_pos(buf, 0);