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