X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fthreshold.c;h=94a4f02449c06fb8093defef6ea2a1095e556352;hb=290741f2e6de9e9b467463c1f0c6f031c4036428;hp=ed8312992b437c9984d6885309bc972f1450fb4d;hpb=6a1a62048b6d0d2ddf5c17295609d3ebf010f40b;p=collectd.git diff --git a/src/threshold.c b/src/threshold.c index ed831299..94a4f024 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -31,7 +31,6 @@ #include "utils_threshold.h" #include -#include /* * Threshold management @@ -70,7 +69,7 @@ static int ut_threshold_add (const threshold_t *th) return (-1); } - th_copy = (threshold_t *) malloc (sizeof (threshold_t)); + th_copy = malloc (sizeof (*th_copy)); if (th_copy == NULL) { sfree (name_copy); @@ -78,7 +77,6 @@ static int ut_threshold_add (const threshold_t *th) return (-1); } memcpy (th_copy, th, sizeof (threshold_t)); - th_ptr = NULL; DEBUG ("ut_threshold_add: Adding entry `%s'", name);