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:
@ -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;
|
||||
|
Reference in New Issue
Block a user