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

@@ -65,7 +65,7 @@ char *group_from_gid(gid_t gid) {
return((*g)->name);
g = &(*g)->next;
}
*g = (struct grpbuf *) malloc(sizeof(struct grpbuf));
*g = (struct grpbuf *) xmalloc(sizeof(struct grpbuf));
(*g)->gid = gid;
gr = getgrgid(gid);
if (!gr || strlen(gr->gr_name) >= P_G_SZ)