X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fconfigfile.c;h=bb57ca26a23e77444b8bafb157e385b8468c84e5;hb=074b4980bc75bea6826e6a38dcc6e193a721b2a8;hp=d483032af71b398d10a44c808c65285e55e805e8;hpb=148e8732e45435a051df1c3673cad0d5dc77492f;p=collectd.git diff --git a/src/configfile.c b/src/configfile.c index d483032a..bb57ca26 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -155,7 +155,8 @@ static int cf_dispatch (const char *type, const char *orig_key, for (i = 0; i < cf_cb->keys_num; i++) { - if (strcasecmp (cf_cb->keys[i], key) == 0) + if ((cf_cb->keys[i] != NULL) + && (strcasecmp (cf_cb->keys[i], key) == 0)) { ret = (*cf_cb->callback) (key, value); break; @@ -276,7 +277,7 @@ static int dispatch_value_plugin (const char *plugin, oconfig_item_t *ci) buffer_ptr = buffer + 1; return (cf_dispatch (plugin, ci->key, buffer_ptr)); -} /* int plugin_conf_dispatch */ +} /* int dispatch_value_plugin */ static int dispatch_value (const oconfig_item_t *ci) { @@ -887,7 +888,11 @@ int cf_read (char *filename) dispatch_block (conf->children + i); } + oconfig_free (conf); + + /* Read the default types.db if no `TypesDB' option was given. */ if (cf_default_typesdb) - read_types_list (PLUGINDIR"/types.db"); /* FIXME: Configure path */ + read_types_list (PLUGINDIR"/types.db"); + return (0); } /* int cf_read */