* ada-lang.c (is_known_support_routine): Add explicit free of
'func_name' from find_frame_funname. (ada_unhandled_exception_name_addr_from_raise): Add cleanups for func_name from find_frame_funname. * python/py-frame.c (frapy_name): Add explicit free of 'name' from find_frame_funname. * stack.c (find_frame_funname): Add comment explaining that funcp must be freed by the caller. Return copy of symbol names instead of pointers. (print_frame): Add a cleanup for 'funname' from find_frame_funname. * stack.h (find_frame_funname): Remove "const" from 'funname' parameter.
This commit is contained in:
parent
5f2e6b00f8
commit
55b87a526f
5 changed files with 53 additions and 17 deletions
|
@ -122,7 +122,7 @@ static PyObject *
|
|||
frapy_name (PyObject *self, PyObject *args)
|
||||
{
|
||||
struct frame_info *frame;
|
||||
const char *name;
|
||||
char *name = NULL;
|
||||
enum language lang;
|
||||
PyObject *result;
|
||||
volatile struct gdb_exception except;
|
||||
|
@ -133,10 +133,17 @@ frapy_name (PyObject *self, PyObject *args)
|
|||
|
||||
find_frame_funname (frame, &name, &lang, NULL);
|
||||
}
|
||||
|
||||
if (except.reason < 0)
|
||||
xfree (name);
|
||||
|
||||
GDB_PY_HANDLE_EXCEPTION (except);
|
||||
|
||||
if (name)
|
||||
result = PyUnicode_Decode (name, strlen (name), host_charset (), NULL);
|
||||
{
|
||||
result = PyUnicode_Decode (name, strlen (name), host_charset (), NULL);
|
||||
xfree (name);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Py_None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue