X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fthreshold.c;h=94a4f02449c06fb8093defef6ea2a1095e556352;hb=95dcf60c822e4ab92c0dd1a7ff6cba73bc55bcd1;hp=ed8312992b437c9984d6885309bc972f1450fb4d;hpb=6286127470b83578c2889db546cfa32cb0fe0147;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);