From: Michael Snyder Date: Mon, 7 Mar 2011 19:53:34 +0000 (+0000) Subject: 2011-03-05 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b2381f5e125bdeb7e7aec65ac6b9647cf04771e;p=binutils-gdb.git 2011-03-05 Michael Snyder * ser-unix.c (hardwire_get_tty_state): Stop memory leak. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8f7a58fb6dd..6cb27eed81c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-03-06 Michael Snyder + * 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 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; }