serial: fix memory leak in case of error out.

This commit is contained in:
Zhang Zhaolong 2014-04-26 13:43:52 +08:00
parent cad2578867
commit e8f34b845e

View File

@ -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);