X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cmd_getthreshold.c;h=b2a0a23bfd892e7b77b6e24c4c1ad3934d69a6bc;hb=a349e06f0c4e2c853eced8a2621f52ee712b6e0c;hp=80babe3ebdc4dc36d63656c5c346ea67e297cc97;hpb=eab8493d114c7c209d90ac54edb7c8026c085747;p=collectd.git diff --git a/src/utils_cmd_getthreshold.c b/src/utils_cmd_getthreshold.c index 80babe3e..b2a0a23b 100644 --- a/src/utils_cmd_getthreshold.c +++ b/src/utils_cmd_getthreshold.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -53,7 +54,6 @@ int handle_getthreshold (FILE *fh, char *buffer) char *type; char *type_instance; - value_list_t vl; threshold_t threshold; int status; @@ -110,7 +110,9 @@ int handle_getthreshold (FILE *fh, char *buffer) return (-1); } - memset (&vl, 0, sizeof (vl)); + value_list_t vl = { + .values = NULL + }; sstrncpy (vl.host, host, sizeof (vl.host)); sstrncpy (vl.plugin, plugin, sizeof (vl.plugin)); if (plugin_instance != NULL) @@ -120,7 +122,6 @@ int handle_getthreshold (FILE *fh, char *buffer) sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); sfree (identifier_copy); - memset (&threshold, 0, sizeof (threshold)); status = ut_search_threshold (&vl, &threshold); if (status == ENOENT) {