projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5cb7819
)
serial: fix memory leak in case of error out.
author
Zhang Zhaolong
<zhangzl2013@126.com>
Sat, 26 Apr 2014 04:24:56 +0000
(12:24 +0800)
committer
Zhang Zhaolong
<zhangzl2013@126.com>
Sat, 26 Apr 2014 04:24:56 +0000
(12:24 +0800)
channels/serial/client/serial_tty.c
patch
|
blob
|
history
diff --git
a/channels/serial/client/serial_tty.c
b/channels/serial/client/serial_tty.c
index
8e051e9
..
b71bd57
100644
(file)
--- a/
channels/serial/client/serial_tty.c
+++ b/
channels/serial/client/serial_tty.c
@@
-426,8
+426,10
@@
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length)
ptermios = (struct termios*) calloc(1, sizeof(struct termios));
- if (tcgetattr(tty->fd, ptermios) < 0)
+ if (tcgetattr(tty->fd, ptermios) < 0) {
+ free(ptermios);
return FALSE;
+ }
/**
* If a timeout is set, do a blocking read, which times out after some time.