summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-30 17:07:42 +0100
committermonsta <[email protected]>2019-07-23 16:18:54 +0300
commitfb212b53d8608dc8416766c65233e74c7af388ce (patch)
tree514005b5ebdfb4dca041c1ad43426eab4915cfb8 /src
parent3eaef9c555ce65fa2a01e60667ec819c237ffc46 (diff)
downloadcaja-fb212b53d8608dc8416766c65233e74c7af388ce.tar.bz2
caja-fb212b53d8608dc8416766c65233e74c7af388ce.tar.xz
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]); ^~~~~~~~~~
Diffstat (limited to 'src')
-rw-r--r--src/caja-application.c7
1 files changed, 4 insertions, 3 deletions
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: