[Xfce4-commits] [xfce/xfce4-session] 05/06: fix coverity cid 87608 Dereference after null check

noreply at xfce.org noreply at xfce.org
Thu May 4 14:08:27 CEST 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-session.

commit e4952f4dbf44acf09c1765f251eccf1a2cb81156
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Thu May 4 15:04:23 2017 +0300

    fix coverity cid 87608 Dereference after null check
---
 xfce4-session/xfsm-global.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/xfce4-session/xfsm-global.c b/xfce4-session/xfsm-global.c
index 6368a9a..e10b8ed 100644
--- a/xfce4-session/xfsm-global.c
+++ b/xfce4-session/xfsm-global.c
@@ -105,9 +105,17 @@ xfsm_verbose_real (const char *func,
             }
         }
 
-      fp = fopen (logfile, "w");
-      g_free (logfile);
-      fprintf(fp, "log file opened\n");
+      if (logfile)
+        {
+          fp = fopen (logfile, "w");
+          g_free (logfile);
+          fprintf(fp, "log file opened\n");
+        }
+    }
+
+  if (fp == NULL)
+    {
+      return;
     }
 
   fprintf (fp, "TRACE[%s:%d] %s(): ", file, line, func);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list