[libgsystem] GSSubprocess: remove unnecessary NULL check (trivial)



commit ca53db5614d57969908cdd8a99bd34394c9e969d
Author: Thomas Haller <thaller redhat com>
Date:   Wed Nov 6 14:11:16 2013 +0100

    GSSubprocess: remove unnecessary NULL check (trivial)
    
    This fixes a warning found during Coverity scan.
    
      Error: REVERSE_INULL (CWE-476): [#def5]
      libgsystem/gsystem-subprocess.c:949: deref_ptr_in_call: Dereferencing pointer "context".
      libgsystem/gsystem-subprocess-context.c:330:3: deref_parm: Directly dereferencing parameter "self".
      libgsystem/gsystem-subprocess.c:960: check_after_deref: Null-checking "context" suggests that it may be 
null, but it has already been dereferenced on all paths leading to the check.
    
    Signed-off-by: Thomas Haller <thaller redhat com>

 gsystem-subprocess.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gsystem-subprocess.c b/gsystem-subprocess.c
index 655b1b8..4ec680f 100644
--- a/gsystem-subprocess.c
+++ b/gsystem-subprocess.c
@@ -957,8 +957,7 @@ gs_subprocess_simple_run_sync (const char                    *cwd,
 
   ret = TRUE;
  out:
-  if (context)
-    g_object_unref (context);
+  g_object_unref (context);
   if (proc)
     g_object_unref (proc);
   return ret;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]