From 9f27a7684fed7b4a53c9228012ef646c5f6c6d60 Mon Sep 17 00:00:00 2001 From: Thomas Osterland Date: Sat, 7 Apr 2018 09:52:12 +0200 Subject: [PATCH] moved NULL check --- i3lock.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/i3lock.c b/i3lock.c index b29dce0..2d29e52 100644 --- a/i3lock.c +++ b/i3lock.c @@ -1840,13 +1840,16 @@ int main(int argc, char *argv[]) { (uint32_t[]){XCB_EVENT_MASK_STRUCTURE_NOTIFY}); init_colors_once(); - if (is_regular_file(image_path)) { - img = load_image(image_path); - } else if (image_path != NULL) { - /* Path to a directory is provided -> use slideshow mode */ - load_slideshow_images(image_path); + if (image_path != NULL) { + if (is_regular_file(image_path)) { + img = load_image(image_path); + } else { + /* Path to a directory is provided -> use slideshow mode */ + load_slideshow_images(image_path); + } + + free(image_path); } - free(image_path); xcb_pixmap_t* blur_pixmap = NULL; if (blur) {