diff --git a/dlls/secur32/dispatcher.c b/dlls/secur32/dispatcher.c index ba59231368e..88e81ba4ae2 100644 --- a/dlls/secur32/dispatcher.c +++ b/dlls/secur32/dispatcher.c @@ -28,7 +28,10 @@ #include #ifdef HAVE_SYS_WAIT_H #include -#endif +#endif +#ifdef HAVE_SYS_ERRNO_H +#include +#endif #include #include #include "windef.h" @@ -276,7 +279,7 @@ void cleanup_helper(PNegoHelper helper) { TRACE("Killing helper %p\n", helper); - if( (helper == NULL) || (helper->helper_pid == 0)) + if(helper == NULL) return; HeapFree(GetProcessHeap(), 0, helper->com_buf); @@ -285,6 +288,16 @@ void cleanup_helper(PNegoHelper helper) close(helper->pipe_out); close(helper->pipe_in); +#ifdef HAVE_FORK + if (helper->helper_pid > 0) /* reap child */ + { + pid_t wret; + do { + wret = waitpid(helper->helper_pid, NULL, 0); + } while (wret < 0 && errno == EINTR); + } +#endif + HeapFree(GetProcessHeap(), 0, helper); }