summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-30 17:07:42 +0100
committerraveit65 <[email protected]>2022-07-19 23:16:46 +0200
commit19af0a0ecc1ee2d736e3ab3fab05f9155663c1b4 (patch)
tree056aaa49e27a6cf17ec13d07e68d1567a4ecbecd
parentf76e68f68f0788747b98925707b0c37d9fa99396 (diff)
downloadcaja-19af0a0ecc1ee2d736e3ab3fab05f9155663c1b4.tar.bz2
caja-19af0a0ecc1ee2d736e3ab3fab05f9155663c1b4.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]); ^~~~~~~~~~
-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: