diff options
author | Doug Evans <dje@google.com> | 2009-05-07 23:29:25 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2009-05-07 23:29:25 +0000 |
commit | fdeb2a1249c984e59e73092df3ca73b4540fb844 (patch) | |
tree | 5fb665567d32edde37a8feea5c73d10d2c4d2cab | |
parent | b39f49881416c6d52bda6a7c7f212f821377743c (diff) | |
download | gdb-fdeb2a1249c984e59e73092df3ca73b4540fb844.zip gdb-fdeb2a1249c984e59e73092df3ca73b4540fb844.tar.gz gdb-fdeb2a1249c984e59e73092df3ca73b4540fb844.tar.bz2 |
* linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
(regsets_store_inferior_registers): Ditto.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 680c168..022f266 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2009-05-07 Doug Evans <dje@google.com> + + * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak. + (regsets_store_inferior_registers): Ditto. + 2009-05-06 Pedro Alves <pedro@codesourcery.com> PR server/10048 diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index bf17904..46969b7 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -2092,6 +2092,7 @@ regsets_fetch_inferior_registers () /* If we get EIO on a regset, do not try it again for this process. */ disabled_regsets[regset - target_regsets] = 1; + free (buf); continue; } else @@ -2106,6 +2107,7 @@ regsets_fetch_inferior_registers () saw_general_regs = 1; regset->store_function (buf); regset ++; + free (buf); } if (saw_general_regs) return 0; @@ -2165,6 +2167,7 @@ regsets_store_inferior_registers () /* If we get EIO on a regset, do not try it again for this process. */ disabled_regsets[regset - target_regsets] = 1; + free (buf); continue; } else if (errno == ESRCH) @@ -2173,6 +2176,7 @@ regsets_store_inferior_registers () already gone, in which case we simply ignore attempts to change its registers. See also the related comment in linux_resume_one_lwp. */ + free (buf); return 0; } else |