From e8f34b845e1cca4d3ca773f00e1d251cdd0b41cb Mon Sep 17 00:00:00 2001 From: Zhang Zhaolong Date: Sat, 26 Apr 2014 13:43:52 +0800 Subject: [PATCH] serial: fix memory leak in case of error out. --- channels/serial/client/serial_tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/channels/serial/client/serial_tty.c b/channels/serial/client/serial_tty.c index b71bd5753..a7d365471 100644 --- a/channels/serial/client/serial_tty.c +++ b/channels/serial/client/serial_tty.c @@ -450,6 +450,7 @@ BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length) tcsetattr(tty->fd, TCSANOW, ptermios); tty->timeout = timeout; + free(ptermios); } ZeroMemory(buffer, *Length);