Skip to content

Commit 008ce8c

Browse files
JordanYatescfriedt
authored andcommitted
tests: net_buf: buf: remove double free
`net_buf_frag_del` already unreferences the deleted fragment. Signed-off-by: Jordan Yates <[email protected]>
1 parent 1d45e17 commit 008ce8c

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

tests/lib/net_buf/buf/prj.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_NET_BUF=y
2-
CONFIG_NET_TEST=y
32
CONFIG_HEAP_MEM_POOL_SIZE=4096
43
#CONFIG_NET_BUF_LOG=y
54
#CONFIG_NET_BUF_LOG_LEVEL_DBG=y

tests/lib/net_buf/buf/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ ZTEST(net_buf_tests, test_net_buf_4)
288288

289289
if ((i % 2) && next) {
290290
net_buf_frag_del(frag, next);
291-
net_buf_unref(next);
292291
removed++;
293292
} else {
294293
frag = next;
@@ -312,7 +311,6 @@ ZTEST(net_buf_tests, test_net_buf_4)
312311
struct net_buf *frag2 = buf->frags;
313312

314313
net_buf_frag_del(buf, frag2);
315-
net_buf_unref(frag2);
316314
removed++;
317315
}
318316

0 commit comments

Comments
 (0)