+2016-08-03 Tom Tromey <tom@tromey.com>
+
+ * stack.c (find_frame_funname): Avoid any possible leak in case
+ cp_remove_params can throw.
+
2016-08-03 Tom Tromey <tom@tromey.com>
* NEWS: Mention new Python breakpoint events.
}
else
{
- *funname = xstrdup (SYMBOL_PRINT_NAME (func));
+ const char *print_name = SYMBOL_PRINT_NAME (func);
+
*funlang = SYMBOL_LANGUAGE (func);
if (funcp)
*funcp = func;
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
- char *func_only = cp_remove_params (*funname);
+ char *func_only = cp_remove_params (print_name);
if (func_only)
- {
- xfree (*funname);
- *funname = func_only;
- }
+ *funname = func_only;
}
+
+ /* If we didn't hit the C++ case above, set *funname here.
+ This approach is taken to avoid having to install a
+ cleanup in case cp_remove_params can throw. */
+ if (*funname == NULL)
+ *funname = xstrdup (print_name);
}
}
else