Avoid potential memory leak in find_frame_funname
authorTom Tromey <tom@tromey.com>
Wed, 3 Aug 2016 14:27:56 +0000 (08:27 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 3 Aug 2016 15:04:08 +0000 (09:04 -0600)
commitd10153cfc6cb319a75ceb3e3d34ac30efa17e518
treed2336732b4fa9c37f5d09253c793764efc7c438e
parent8d2a0a14e53945eb260c08752654bd03a240ecf7
Avoid potential memory leak in find_frame_funname

The PR 18565 thread pointed out that, if cp_remove_params can throw
(we aren't quite sure), then find_frame_funname could leak some
memory.  This patch avoids any potential issue by rearranging some
code in find_frame_funname.

Built and regtested on x86-64 Fedora 24.

2016-08-03  Tom Tromey  <tom@tromey.com>

* stack.c (find_frame_funname): Avoid any possible leak in case
cp_remove_params can throw.
gdb/ChangeLog
gdb/stack.c