summaryrefslogtreecommitdiff
path: root/gdb/ser-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ser-unix.c')
-rw-r--r--gdb/ser-unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index da3a4c30b61..c541452a8cc 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -183,7 +183,10 @@ hardwire_get_tty_state (struct serial *scb)
state = (struct hardwire_ttystate *) xmalloc (sizeof *state);
if (get_tty_state (scb, state))
- return NULL;
+ {
+ xfree (state);
+ return NULL;
+ }
return (serial_ttystate) state;
}