From f12ed4ff5492676015b64ea0d5bd1593018a07cd Mon Sep 17 00:00:00 2001 From: Christian Carey Date: Fri, 2 May 2025 00:02:46 -0400 Subject: [PATCH] Resolve issue #1513. --- src/fe-text/mainwindows.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 26b94248..b9f77c0a 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -233,8 +233,10 @@ MAIN_WINDOW_REC *mainwindow_create(int right) if (MAIN_WINDOW_TEXT_HEIGHT(parent) < WINDOW_MIN_SIZE+NEW_WINDOW_SIZE) parent = find_window_with_room(); - if (parent == NULL) + if (parent == NULL) { + g_free(rec); return NULL; /* not enough space */ + } space = parent->height / 2; rec->first_line = parent->first_line; @@ -255,8 +257,10 @@ MAIN_WINDOW_REC *mainwindow_create(int right) if (MAIN_WINDOW_TEXT_WIDTH(parent) < 2 * NEW_WINDOW_WIDTH) { parent = find_window_with_room_right(); } - if (parent == NULL) + if (parent == NULL) { + g_free(rec); return NULL; /* not enough space */ + } space = parent->width / 2; rec->first_line = parent->first_line;