diff --git a/src/fe-common/core/command-history.c b/src/fe-common/core/command-history.c index 1642c798..18abd834 100644 --- a/src/fe-common/core/command-history.c +++ b/src/fe-common/core/command-history.c @@ -221,9 +221,7 @@ static void sig_window_destroyed(WINDOW_REC *window) { command_history_unlink(window->history_name); command_history_destroy(window->history); - g_free_not_null(window->history_name); - g_free_not_null(window->history); } static void sig_window_history_changed(WINDOW_REC *window, const char *oldname) diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c index 53ff7a02..fc4766d9 100644 --- a/src/fe-common/core/fe-windows.c +++ b/src/fe-common/core/fe-windows.c @@ -200,7 +200,7 @@ void window_set_history(WINDOW_REC *window, const char *name) char *oldname; oldname = window->history_name; - if (*name == '\0') + if (name == NULL || *name == '\0') window->history_name = NULL; else window->history_name = g_strdup(name);