From 7368bf2a94337b18b67a0c3573ddb2d71534ae8d Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Thu, 10 Dec 2015 19:38:04 +0100 Subject: [PATCH] swap plugin: don't exit when malloc fails Signed-off-by: Florian Forster --- src/swap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } -- 2.11.0