kernel: fix more malloc/smalloc errors
This commit is contained in:
parent
304ee3b2b5
commit
8cb8043d0e
13 changed files with 34 additions and 26 deletions
|
@ -45,13 +45,15 @@ initseg(void)
|
|||
Image *i, *ie;
|
||||
|
||||
imagealloc.free = xalloc(conf.nimage*sizeof(Image));
|
||||
if (imagealloc.free == nil)
|
||||
panic("initseg: no memory");
|
||||
if(imagealloc.free == nil)
|
||||
panic("initseg: no memory for Image");
|
||||
ie = &imagealloc.free[conf.nimage-1];
|
||||
for(i = imagealloc.free; i < ie; i++)
|
||||
i->next = i+1;
|
||||
i->next = 0;
|
||||
imagealloc.freechan = malloc(NFREECHAN * sizeof(Chan*));
|
||||
if(imagealloc.freechan == nil)
|
||||
panic("initseg: no memory for Chan");
|
||||
imagealloc.szfreechan = NFREECHAN;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue