From 598d3a15b7beeb4d994d89b54ddb8e9ae24e9da9 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 10 Feb 2020 15:49:20 +0100 Subject: [PATCH] clients/window: fail earlier when frame_create fails This adds a new NULL check to fail earlier when frame_create fails. This can happen because PNG files couldn't be loaded from the data directory. Signed-off-by: Simon Ser --- clients/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/window.c b/clients/window.c index 1bb9f3dc..970d54ce 100644 --- a/clients/window.c +++ b/clients/window.c @@ -2577,6 +2577,10 @@ window_frame_create(struct window *window, void *data) frame = xzalloc(sizeof *frame); frame->frame = frame_create(window->display->theme, 0, 0, buttons, window->title, NULL); + if (!frame->frame) { + free(frame); + return NULL; + } frame->widget = window_add_widget(window, frame); frame->child = widget_add_widget(frame->widget, data);