From: Ruben Kerkhof Date: Thu, 10 Dec 2015 18:38:04 +0000 (+0100) Subject: swap plugin: don't exit when malloc fails X-Git-Tag: collectd-5.5.1~13^2~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=7368bf2a94337b18b67a0c3573ddb2d71534ae8d;p=collectd.git swap plugin: don't exit when malloc fails Signed-off-by: Florian Forster --- diff --git a/src/swap.c b/src/swap.c index fb50cf38..8d8f7525 100644 --- a/src/swap.c +++ b/src/swap.c @@ -534,10 +534,10 @@ static int swap_read (void) /* {{{ */ return (0); /* Allocate and initialize the swaptbl_t structure */ - s = (swaptbl_t *) smalloc (swap_num * sizeof (swapent_t) + sizeof (struct swaptable)); + s = malloc (swap_num * sizeof (swapent_t) + sizeof (struct swaptable)); if (s == NULL) { - ERROR ("swap plugin: smalloc failed."); + ERROR ("swap plugin: malloc failed."); return (-1); } @@ -547,7 +547,7 @@ static int swap_read (void) /* {{{ */ s_paths = calloc (swap_num, PATH_MAX); if (s_paths == NULL) { - ERROR ("swap plugin: malloc failed."); + ERROR ("swap plugin: calloc failed."); sfree (s); return (-1); }