* linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.

(regsets_store_inferior_registers): Ditto.
This commit is contained in:
Doug Evans 2009-05-07 23:29:25 +00:00
parent b39f498814
commit fdeb2a1249
2 changed files with 9 additions and 0 deletions

View File

@ -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> 2009-05-06 Pedro Alves <pedro@codesourcery.com>
PR server/10048 PR server/10048

View File

@ -2092,6 +2092,7 @@ regsets_fetch_inferior_registers ()
/* If we get EIO on a regset, do not try it again for /* If we get EIO on a regset, do not try it again for
this process. */ this process. */
disabled_regsets[regset - target_regsets] = 1; disabled_regsets[regset - target_regsets] = 1;
free (buf);
continue; continue;
} }
else else
@ -2106,6 +2107,7 @@ regsets_fetch_inferior_registers ()
saw_general_regs = 1; saw_general_regs = 1;
regset->store_function (buf); regset->store_function (buf);
regset ++; regset ++;
free (buf);
} }
if (saw_general_regs) if (saw_general_regs)
return 0; return 0;
@ -2165,6 +2167,7 @@ regsets_store_inferior_registers ()
/* If we get EIO on a regset, do not try it again for /* If we get EIO on a regset, do not try it again for
this process. */ this process. */
disabled_regsets[regset - target_regsets] = 1; disabled_regsets[regset - target_regsets] = 1;
free (buf);
continue; continue;
} }
else if (errno == ESRCH) else if (errno == ESRCH)
@ -2173,6 +2176,7 @@ regsets_store_inferior_registers ()
already gone, in which case we simply ignore attempts already gone, in which case we simply ignore attempts
to change its registers. See also the related to change its registers. See also the related
comment in linux_resume_one_lwp. */ comment in linux_resume_one_lwp. */
free (buf);
return 0; return 0;
} }
else else