projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1454 from rubenk/libi2c-dev-mark-as-linux-only
[collectd.git]
/
src
/
zfs_arc.c
diff --git
a/src/zfs_arc.c
b/src/zfs_arc.c
index
dd633d5
..
41a89b1
100644
(file)
--- a/
src/zfs_arc.c
+++ b/
src/zfs_arc.c
@@
-186,7
+186,7
@@
static int za_read (void)
return (-1);
}
return (-1);
}
- len = read_file_contents (ZOL_ARCSTATS_FILE, file_contents, sizeof(file_contents));
+ len = read_file_contents (ZOL_ARCSTATS_FILE, file_contents, sizeof(file_contents)
- 1
);
if (len > 1)
{
if (len > 1)
{
@@
-208,6
+208,11
@@
static int za_read (void)
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
+ if (llvalues == NULL)
+ {
+ ERROR ("zfs_arc plugin: `malloc' failed.");
+ return (-1);
+ }
int j = 0;
pnl = file_contents;
int j = 0;
pnl = file_contents;