serial: fix memory leak in case of error out.
This commit is contained in:
parent
cad2578867
commit
e8f34b845e
@ -450,6 +450,7 @@ BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length)
|
|||||||
|
|
||||||
tcsetattr(tty->fd, TCSANOW, ptermios);
|
tcsetattr(tty->fd, TCSANOW, ptermios);
|
||||||
tty->timeout = timeout;
|
tty->timeout = timeout;
|
||||||
|
free(ptermios);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZeroMemory(buffer, *Length);
|
ZeroMemory(buffer, *Length);
|
||||||
|
Loading…
Reference in New Issue
Block a user