- make_cleanup (xfree, filename);
- TRY_CATCH (except, RETURN_MASK_ALL)
- {
- ui_out_wrap_hint (out, " ");
- ui_out_text (out, " at ");
- annotate_frame_source_file ();
- ui_out_field_string (out, "file", filename);
- annotate_frame_source_file_end ();
- }
- if (except.reason < 0)
- {
- Py_DECREF (py_fn);
- gdbpy_convert_exception (except);
- goto error;
- }
+ if (filename == NULL)
+ {
+ do_cleanups (cleanup_stack);
+ return EXT_LANG_BT_ERROR;
+ }
+
+ make_cleanup (xfree, filename);
+ TRY_CATCH (except, RETURN_MASK_ERROR)
+ {
+ ui_out_wrap_hint (out, " ");
+ ui_out_text (out, " at ");
+ annotate_frame_source_file ();
+ ui_out_field_string (out, "file", filename);
+ annotate_frame_source_file_end ();
+ }
+ if (except.reason < 0)
+ {
+ gdbpy_convert_exception (except);
+ do_cleanups (cleanup_stack);
+ return EXT_LANG_BT_ERROR;