From e3e944cf879ee5f1b73091d21f1519b0f29bc15c Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Mon, 7 Mar 2011 19:53:32 +0000 Subject: 2011-03-05 Michael Snyder * ser-unix.c (hardwire_get_tty_state): Stop memory leak. --- gdb/ser-unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdb/ser-unix.c') 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; } -- cgit v1.2.1