summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bffdff)
raw | patch | inline | side by side (parent: 8bffdff)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:59:27 +0000 (17:59 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 1 Apr 2016 15:59:27 +0000 (17:59 +0200) |
src/nut.c | patch | blob | history |
diff --git a/src/nut.c b/src/nut.c
index 9540d7c47fdf3dd4f4b146454ea22ab47bc49cb7..17eb1b9abc347b79bafb42454aa38956960f43eb 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
DEBUG ("nut plugin: nut_add_ups (name = %s);", name);
- ups = malloc (sizeof (*ups));
+ ups = calloc (1, sizeof (*ups));
if (ups == NULL)
{
- ERROR ("nut plugin: nut_add_ups: malloc failed.");
+ ERROR ("nut plugin: nut_add_ups: calloc failed.");
return (1);
}
- memset (ups, '\0', sizeof (nut_ups_t));
status = upscli_splitname (name, &ups->upsname, &ups->hostname,
&ups->port);