From: Ruben Kerkhof Date: Sat, 5 Dec 2015 13:14:54 +0000 (+0100) Subject: zfs-arc plugin: check return value of malloc X-Git-Tag: collectd-5.5.1~28 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=438651f58b05cbbc5d5ddf3d465da62e0d8bde40;p=collectd.git zfs-arc plugin: check return value of malloc CID #37989 Signed-off-by: Florian Forster --- diff --git a/src/zfs_arc.c b/src/zfs_arc.c index 540a1db4..86e7d4c5 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -208,6 +208,11 @@ static int za_read (void) { 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;