projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: cleanup whitespace
[collectd.git]
/
src
/
daemon
/
utils_cache.c
diff --git
a/src/daemon/utils_cache.c
b/src/daemon/utils_cache.c
index
7f0d228
..
b5b059c
100644
(file)
--- a/
src/daemon/utils_cache.c
+++ b/
src/daemon/utils_cache.c
@@
-83,13
+83,12
@@
static cache_entry_t *cache_alloc (size_t values_num)
{
cache_entry_t *ce;
{
cache_entry_t *ce;
- ce =
malloc (
sizeof (*ce));
+ ce =
calloc (1,
sizeof (*ce));
if (ce == NULL)
{
if (ce == NULL)
{
- ERROR ("utils_cache: cache_alloc:
m
alloc failed.");
+ ERROR ("utils_cache: cache_alloc:
c
alloc failed.");
return (NULL);
}
return (NULL);
}
- memset (ce, '\0', sizeof (cache_entry_t));
ce->values_num = values_num;
ce->values_gauge = calloc (values_num, sizeof (*ce->values_gauge));
ce->values_num = values_num;
ce->values_gauge = calloc (values_num, sizeof (*ce->values_gauge));
@@
-247,7
+246,7
@@
int uc_check_timeout (void)
int status;
int i;
int status;
int i;
-
+
pthread_mutex_lock (&cache_lock);
now = cdtime ();
pthread_mutex_lock (&cache_lock);
now = cdtime ();