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: [rfa] py-value.c, memory leak


Tom Tromey wrote:
"Michael" == Michael Snyder <msnyder@vmware.com> writes:

Michael> Feel like I need review for this... Michael> 2011-02-27 Michael Snyder <msnyder@vmware.com> Michael> * python/py-value.c (valpy_str): Fix memory leak.

First, I think the cleanup logic in this function is already a little
wrong.

Suppose the code in the TRY_CATCH throws an exception.  Then,
GDB_PY_HANDLE_EXCEPTION will do an early return -- but `stb' will never
be freed.


Second, I don't think this patch is needed. I don't think there is a situation where `s' can be non-NULL and where the early return can be taken. For that to happen, something would have to throw an exception between the assignment and the end of the TRY_CATCH, which is impossible.

Tom

All right -- withdrawn.



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