nibblebits / PeachOS

Simple kernel designed for a online course
GNU General Public License v2.0
133 stars 55 forks source link

memory not freed #10

Open nikolaospanagopoulos opened 1 year ago

nikolaospanagopoulos commented 1 year ago

`

elf_file->elf_memory = kzalloc(stat.filesize);
res = fread(elf_file->elf_memory, stat.filesize, 1, fd);
if (res < 0)
{
    goto out;
}

res = elf_process_loaded(elf_file);
if(res < 0)
{
    goto out;
}

`

in elfloader.c file, in the elf_load function, we dont free the memory we allocated with kzalloc, if we fail to read the file or if we fail to load the file