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 <unistd.h>
#include "version.h"
#include "devname.h"
#include "alloc.h"
// This is the buffer size for a tty name. Any path is legal,
// which makes PAGE_SIZE appropriate (see kernel source), but
@@ -75,7 +76,7 @@ static void load_drivers(void){
end = strchr(p, ' ');
if(!end) continue;
len = end - p;
tmn = calloc(1, sizeof(tty_map_node));
tmn = xcalloc(sizeof(tty_map_node));
tmn->next = tty_map;
tty_map = tmn;
/* if we have a devfs type name such as /dev/tts/%d then strip the %d but