X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnut.c;h=9540d7c47fdf3dd4f4b146454ea22ab47bc49cb7;hb=1ebf2f31;hp=d5ecc98de12b13a811f7e36fc131eaf36dfb6c19;hpb=6894d846ac42cbe88073db074d75279f5a6e31b8;p=collectd.git diff --git a/src/nut.c b/src/nut.c index d5ecc98d..9540d7c4 100644 --- a/src/nut.c +++ b/src/nut.c @@ -80,7 +80,7 @@ static int nut_add_ups (const char *name) DEBUG ("nut plugin: nut_add_ups (name = %s);", name); - ups = (nut_ups_t *) malloc (sizeof (nut_ups_t)); + ups = malloc (sizeof (*ups)); if (ups == NULL) { ERROR ("nut plugin: nut_add_ups: malloc failed."); @@ -152,7 +152,7 @@ static int nut_read_one (nut_ups_t *ups) /* (Re-)Connect if we have no connection */ if (ups->conn == NULL) { - ups->conn = (collectd_upsconn_t *) malloc (sizeof (collectd_upsconn_t)); + ups->conn = malloc (sizeof (*ups->conn)); if (ups->conn == NULL) { ERROR ("nut plugin: malloc failed.");