Explorar el Código

fix: ulwip,dhcp,处理dhcp包时,若分配内存失败,应该打印错误日志

Wendal Chen hace 6 meses
padre
commit
2b6fc106f1
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      components/network/ulwip/src/ulwip_dhcp_client.c

+ 1 - 0
components/network/ulwip/src/ulwip_dhcp_client.c

@@ -129,6 +129,7 @@ static int ulwip_dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const
     u16_t total_len = p->tot_len;
     u16_t total_len = p->tot_len;
     char* ptr = luat_heap_malloc(total_len);
     char* ptr = luat_heap_malloc(total_len);
     if (!ptr) {
     if (!ptr) {
+        LLOGE("malloc fail when parse dhcp packet %d", p->tot_len);
         pbuf_free(p);
         pbuf_free(p);
         return ERR_OK;
         return ERR_OK;
     }
     }