summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/gui-cursor.c3
-rw-r--r--src/gui/gui-focus.c3
-rw-r--r--src/gui/gui-key.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/gui-cursor.c b/src/gui/gui-cursor.c
index bc8f387d0..11f79093b 100644
--- a/src/gui/gui-cursor.c
+++ b/src/gui/gui-cursor.c
@@ -378,8 +378,7 @@ gui_cursor_move_area_add_xy (int add_x, int add_y)
}
gui_focus_free_info (focus_info_old);
- if (focus_info_new)
- gui_focus_free_info (focus_info_new);
+ gui_focus_free_info (focus_info_new);
}
/*
diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c
index f61cf61fd..50ed3a704 100644
--- a/src/gui/gui-focus.c
+++ b/src/gui/gui-focus.c
@@ -100,6 +100,9 @@ gui_focus_get_info (int x, int y)
void
gui_focus_free_info (struct t_gui_focus_info *focus_info)
{
+ if (!focus_info)
+ return;
+
free (focus_info->chat_word);
free (focus_info->chat_focused_line);
free (focus_info->chat_focused_line_bol);
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c
index ab776f2c5..3e5a552fa 100644
--- a/src/gui/gui-key.c
+++ b/src/gui/gui-key.c
@@ -2243,10 +2243,8 @@ gui_key_focus (const char *key, int context)
rc = gui_key_focus_command (key, context, hashtable_focus);
end:
- if (focus_info1)
- gui_focus_free_info (focus_info1);
- if (focus_info2)
- gui_focus_free_info (focus_info2);
+ gui_focus_free_info (focus_info1);
+ gui_focus_free_info (focus_info2);
hashtable_free (hashtable_focus[0]);
hashtable_free (hashtable_focus[1]);