From d33f889a560f64e22d4729ec04e227ee8ebc72a6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 9 Apr 2021 18:10:45 +0100 Subject: [PATCH] gtkwin: remove a redundant test in delete_window. We never expect to be passed a NULL GtkFrontend pointer, and even if we were, we'd have crashed several lines above this test. It was benign, of course, but Coverity (which pointed it out) dislikes this kind of thing on the basis that it's confusing - you ought to either test it for NULL properly, or not at all - and I see its point. --- unix/gtkwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 9ed8b431..2a2353d4 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -624,7 +624,7 @@ gint delete_window(GtkWidget *widget, GdkEvent *event, GtkFrontend *inst) if (!find_and_raise_dialog(inst, DIALOG_SLOT_WARN_ON_CLOSE)) { char *title = dupcat(appname, " Exit Confirmation"); char *msg, *additional = NULL; - if (inst && inst->backend && inst->backend->vt->close_warn_text) { + if (inst->backend && inst->backend->vt->close_warn_text) { additional = inst->backend->vt->close_warn_text(inst->backend); } msg = dupprintf("Are you sure you want to close this session?%s%s",