library: exploit enhanced library memory allocation provisions

There were numerous library memory allocation inconsistencies.
Some were checked for failure and others were not.

All library source modules were modified to utilize the alloc.h
memory rouines which are consistent in dealing with errors.
This commit is contained in:
Jim Warner
2011-12-02 17:17:02 -06:00
committed by Craig Small
parent 7126cc4491
commit 827334870d
6 changed files with 26 additions and 40 deletions

View File

@ -18,6 +18,7 @@
#include "slab.h"
#include "procps.h"
#include "alloc.h"
#define SLABINFO_LINE_LEN 2048
#define SLABINFO_VER_LEN 100
@ -41,9 +42,7 @@ static struct slab_info *get_slabnode(void)
node = free_index;
free_index = free_index->next;
} else {
node = malloc(sizeof(struct slab_info));
if (!node)
perror("malloc");
node = xmalloc(sizeof(struct slab_info));
}
return node;