vmm: destroy context

This commit is contained in:
Matheus
2022-10-11 23:31:54 -03:00
parent 144ad8cacf
commit 0e4c9e17bf
4 changed files with 27 additions and 2 deletions
+4 -1
View File
@@ -28,7 +28,10 @@ syscallret syscall_fork(arch_regs* ctx){
int err = vmm_fork(thread->ctx, newthread->ctx);
if(err){
printf("fork: VMM_FORK FAILED BUT THREAD DEALLOCATION IS NOT SUPPORTED YET!\n");
vmm_destroy(newthread->ctx);
free(newthread->regs);
free(newthread->kernelstackbase);
free(newthread);
retv.errno = err;
return retv;
}
+2 -1
View File
@@ -99,9 +99,10 @@ syscallret syscall_waitpid(pid_t pid, int *status, int options){
thread_t* thread = child->threads;
// TODO free ctx
free(thread->regs);
free(thread->kernelstackbase);
vmm_destroy(thread->ctx);
free(thread);
free(child);