--- res/res_agi.c.ORIG 2008-04-21 09:53:57.000000000 -0500 +++ res/res_agi.c 2008-05-14 12:08:50.000000000 -0500 @@ -2071,6 +2071,11 @@ close(fds[1]); if (efd > -1) close(efd); + /* In case run_agi forgot to call waitpid() or friends, be sure + that it has been called or else we'll start leaving zombies + around... */ + if (pid > 0) + waitpid(pid, &status, 0); } ast_unreplace_sigchld(); ast_module_user_remove(u);