This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d1f083ae hal_uart: Fix loop_slave file descriptor leak
2d1f083ae is described below

commit 2d1f083ae680981f1af538b228a0ef2fa7f65a1b
Author: Emma Stensland <[email protected]>
AuthorDate: Mon Jul 20 13:37:54 2026 -0600

    hal_uart: Fix loop_slave file descriptor leak
    
    The loop_slave file descriptor opened by openpty() in uart_pty()
    was never closed, leading to a resource leak.
---
 hw/mcu/native/src/hal_uart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index d16854bf8..84ebc4f9c 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -288,6 +288,7 @@ uart_pty(int port)
         goto err;
     }
 
+    close(loop_slave);
     snprintf(msg, sizeof(msg), "uart%d at %s\n", port, pty_name);
     write(1, msg, strlen(msg));
     return fd;

Reply via email to