plugin.c: fix potential null pointer dereference
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 09:57:25 +0000 (11:57 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 23 Apr 2016 09:57:25 +0000 (11:57 +0200)
[src/daemon/plugin.c:2095] -> [src/daemon/plugin.c:2091]: (warning) Either the condition 'vl==0' is redundant or there is possible null pointer dereference: vl.

src/daemon/plugin.c

index 7e905f9..fa78fa0 100644 (file)
@@ -2088,8 +2088,10 @@ static int plugin_dispatch_values_internal (value_list_t *vl)
 
        int free_meta_data = 0;
 
-       if ((vl == NULL) || (vl->type[0] == 0)
-                       || (vl->values == NULL) || (vl->values_len < 1))
+       assert(vl);
+       assert(vl->plugin);
+
+       if (vl->type[0] == 0 || vl->values == NULL || vl->values_len < 1)
        {
                ERROR ("plugin_dispatch_values: Invalid value list "
                                "from plugin %s.", vl->plugin);