From b80f4cd0b3d5ea5349599ef12dd13a0bedafb3b9 Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Mon, 22 Apr 2024 15:11:21 +0000
Subject: [PATCH] fix udp recv memleak

---
 src/api/api_msg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/api/api_msg.c b/src/api/api_msg.c
index f0a3e0b..9da4869 100644
--- a/src/api/api_msg.c
+++ b/src/api/api_msg.c
@@ -286,6 +286,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
   p->port = port;
   len = p->tot_len;
   if (sys_mbox_trypost(&conn->recvmbox, p) != ERR_OK) {
+    pbuf_free(p);
     return;
 #else /* GAZELLE_UDP_ENABLE */
   err_t err;
-- 
2.33.0

