[gom] gom: Fix impossible pointer dereference



commit 2315e28f7c798e16b6eb3a102afc71fd0c553dfb
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 26 16:29:16 2015 +0200

    gom: Fix impossible pointer dereference
    
    gom-0.2.1/gom/gom-command-builder.c:849: check_after_deref: Null-checking "str" suggests that it may be 
null, but it has already been dereferenced on all paths leading to the check.
    gom-0.2.1/gom/gom-command-builder.c:762: check_after_deref: Null-checking "str" suggests that it may be 
null, but it has already been dereferenced on all paths leading to the check.

 gom/gom-command-builder.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/gom/gom-command-builder.c b/gom/gom-command-builder.c
index 4534246..a80deda 100644
--- a/gom/gom-command-builder.c
+++ b/gom/gom-command-builder.c
@@ -789,9 +789,7 @@ gom_command_builder_build_insert (GomCommandBuilder *builder,
    }
 
    g_type_class_unref(klass);
-   if (str) {
-      g_string_free(str, TRUE);
-   }
+   g_string_free(str, TRUE);
    g_free(pspecs);
 
    return command;
@@ -875,11 +873,7 @@ gom_command_builder_build_update (GomCommandBuilder *builder,
    }
 
    g_type_class_unref(klass);
-
-   if (str) {
-      g_string_free(str, TRUE);
-   }
-
+   g_string_free(str, TRUE);
    g_free(pspecs);
 
    return command;


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