X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fthreshold.c;h=e849b1d8b921fd2da5d7d1f3f98eaf20d7a07e2a;hb=42ca41a0798e3a2b742f7da3bacc03fbaf6175fa;hp=ed8312992b437c9984d6885309bc972f1450fb4d;hpb=82c9b0daf5ff90d01f4a4371f11727cd613e4b01;p=collectd.git diff --git a/src/threshold.c b/src/threshold.c index ed831299..e849b1d8 100644 --- a/src/threshold.c +++ b/src/threshold.c @@ -70,7 +70,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 +78,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);