From fb212b53d8608dc8416766c65233e74c7af388ce Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 30 Mar 2019 17:07:42 +0100 Subject: caja-application: avoid NULL inside 'g_object_unref' Fixes Clang static analyzer warning: caja-application.c:2221:25: warning: Array access (from variable 'files') results in a null pointer dereference g_object_unref (files[idx]); ^~~~~~~~~~ --- src/caja-application.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/caja-application.c b/src/caja-application.c index 11578673..090c3dd9 100644 --- a/src/caja-application.c +++ b/src/caja-application.c @@ -2226,9 +2226,10 @@ caja_application_local_command_line (GApplication *application, g_free (concatOptions); } - for (idx = 0; idx < len; idx++) { - g_object_unref (files[idx]); - } + if (files) + for (idx = 0; idx < len; idx++) { + g_object_unref (files[idx]); + } g_free (files); out: -- cgit v1.2.1