projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utils_cache_mock: fix annotations
[collectd.git]
/
src
/
nut.c
diff --git
a/src/nut.c
b/src/nut.c
index
9540d7c
..
a033e2f
100644
(file)
--- a/
src/nut.c
+++ b/
src/nut.c
@@
-28,7
+28,6
@@
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
-#include <pthread.h>
#include <upsclient.h>
#if HAVE_UPSCONN_T
#include <upsclient.h>
#if HAVE_UPSCONN_T
@@
-80,13
+79,12
@@
static int nut_add_ups (const char *name)
DEBUG ("nut plugin: nut_add_ups (name = %s);", name);
DEBUG ("nut plugin: nut_add_ups (name = %s);", name);
- ups =
malloc (
sizeof (*ups));
+ ups =
calloc (1,
sizeof (*ups));
if (ups == NULL)
{
if (ups == NULL)
{
- ERROR ("nut plugin: nut_add_ups:
m
alloc failed.");
+ ERROR ("nut plugin: nut_add_ups:
c
alloc failed.");
return (1);
}
return (1);
}
- memset (ups, '\0', sizeof (nut_ups_t));
status = upscli_splitname (name, &ups->upsname, &ups->hostname,
&ups->port);
status = upscli_splitname (name, &ups->upsname, &ups->hostname,
&ups->port);