This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb/record-full: Use xmalloc instead of alloca for large buffers.


> > gdb/ChangeLog:
> > 
> > 	* record-full.c (record_full_exec_insn): Use xmalloc for large buffers.
> 
> I think this may leak memory if some code between the xmalloc and the xfree
> throws a GDB exception.  Usually, this is protected against by calling the
> xfree via the make_cleanup mechanism ...

Also, why not just call xmalloc every time instead of doing
a combination of alloca and xmalloc? I don't see enough benefits
to justify the extra complication.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]