diff options
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/ser-unix.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8f7a58f..6cb27ee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-03-06 Michael Snyder <msnyder@vmware.com> + * ser-unix.c (hardwire_get_tty_state): Stop memory leak. + * mi/mi-cmd-env.c (_initialize_mi_cmd_env): Free environment. * elfread.c (elf_symtab_read): Stop memory leak. diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index da3a4c3..c541452 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; } |