![]() | ||||||||||
Messages in this thread Patch in this message |
Hello, I think I have noticed a small memory leak in exec.c:flush_old_exec(). If exec_mmap() fails on a process that has CLONE_SIGHAND created clones then the kmalloc'ed signal_struct won't be freed. I have attached a small patch that should fix this (untested as it as it is not an easily reprodable scenerio) Peeter -- Peeter Joot http://www.accessv.com/~peeter peeter@accessv.com --- exec.c.orig Fri Jan 2 00:16:39 1998 +++ exec.c Fri Jan 2 00:16:07 1998 @@ -518,7 +518,7 @@ * Release all of the old mmap stuff */ retval = exec_mmap(); - if (retval) goto flush_failed; + if (retval) goto mmap_failed; /* This is the point of no return */ release_old_signals(oldsig); @@ -547,6 +547,9 @@ return 0; +mmap_failed: + if (current->sig != oldsig) + kfree(current->sig); flush_failed: current->sig = oldsig; return retval; | |||||||||
| Last update: 2005-03-22 12:41 [from the cache] ©2003-2008 | ||||||||||