kernel: fix more malloc/smalloc errors

This commit is contained in:
cinap_lenrek 2011-12-12 19:17:58 +01:00
parent 304ee3b2b5
commit 8cb8043d0e
13 changed files with 34 additions and 26 deletions

View file

@ -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;
}