This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFAv2] Fix leak in displaced step.
On 2018-11-12 10:34 a.m., David Blaikie wrote:
> Any chance this could use unique_xmalloc_ptr to reduce the risk of leaking
> a bit? (I guess that'd probably mean handling the ownership of
> displaced_step_inferorior_state, since it'd then have a non-trivial dtor,
> so it couldn't just be xmalloc/xfree'd and would need similar
> unique_xmalloc_ptr handling, etc?)
I think it would be the right way, yes. If we need the buffer to be resizable,
we could use a vector (gdb::byte_vector), but in any case
displaced_step_inferior_state would need the same treatment.
Simon