int i;
const char *name;
unsigned int flags = 0;
- plugin_ctx_t ctx;
+ plugin_ctx_t ctx = { 0 };
plugin_ctx_t old_ctx;
int ret_val;
name = "virt";
/* default to the global interval set before loading this plugin */
- memset (&ctx, 0, sizeof (ctx));
ctx.interval = cf_get_default_interval ();
ctx.flush_interval = 0;
ctx.flush_timeout = 0;
if (IS_TRUE (global_option_get ("AutoLoadPlugin")))
{
- plugin_ctx_t ctx;
+ plugin_ctx_t ctx = { 0 };
plugin_ctx_t old_ctx;
int status;
/* default to the global interval set before loading this plugin */
- memset (&ctx, 0, sizeof (ctx));
ctx.interval = cf_get_default_interval ();
old_ctx = plugin_set_ctx (ctx);
break;
if (i >= cf_global_options_num)
+ {
+ ERROR ("configfile: Cannot set unknown global option `%s'.", option);
return (-1);
+ }
if (cf_global_options[i].from_cli && (! from_cli))
{
- DEBUG ("Configfile: Ignoring %s `%s' option because "
+ DEBUG ("configfile: Ignoring %s `%s' option because "
"it was overriden by a command-line option.",
option, value);
return (0);
break;
if (i >= cf_global_options_num)
+ {
+ ERROR ("configfile: Cannot get unknown global option `%s'.", option);
return (NULL);
+ }
return ((cf_global_options[i].value != NULL)
? cf_global_options[i].value