summaryrefslogtreecommitdiff
path: root/src/caja-application.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-30 17:07:42 +0100
committerZenWalker <[email protected]>2019-04-07 21:38:59 +0200
commitf22f7055d51f9e872797aa96efcb5f0531ff6fa9 (patch)
tree9ad4aec6b1229eda7ce180e6f85cc74d4f228376 /src/caja-application.c
parent4dcb2701ac7789166a3167d1e6fb0c4a4c9e4c9b (diff)
downloadcaja-f22f7055d51f9e872797aa96efcb5f0531ff6fa9.tar.bz2
caja-f22f7055d51f9e872797aa96efcb5f0531ff6fa9.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/caja-application.c')
-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 ed4eaca9..e158beab 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -2217,9 +2217,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: