From: Ruben Kerkhof Date: Sat, 23 Apr 2016 09:57:25 +0000 (+0200) Subject: plugin.c: fix potential null pointer dereference X-Git-Tag: collectd-5.6.0~329^2~13 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=27cdc98ad884eba8581571d90e94770ee4de597b;p=collectd.git plugin.c: fix potential null pointer dereference [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. --- diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 7e905f97..fa78fa02 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -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);