Fix one of the valgrind warnings from bug #6814 - Fixes for problems reported by...
authorRoel van Meer <rolek@alt001.com>
Fri, 26 Feb 2010 22:54:22 +0000 (14:54 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 26 Feb 2010 22:54:22 +0000 (14:54 -0800)
The timeval passed to event_add_to_select_args() must be initialized
as event_add_to_select_args() uses a timeval_min() on this and next_event.

source3/winbindd/winbindd_dual.c

index 74b2b99b7f27551afd720132997e94e87447bcd1..26f92322a1e9588f0c3abb3ffca0c6cd21df368b 100644 (file)
@@ -1463,6 +1463,14 @@ static bool fork_domain_child(struct winbindd_child *child)
                FD_SET(state.sock, &r_fds);
                maxfd = state.sock;
 
                FD_SET(state.sock, &r_fds);
                maxfd = state.sock;
 
+               /*
+                * Initialize this high as event_add_to_select_args()
+                * uses a timeval_min() on this and next_event. Fix
+                * from Roel van Meer <rolek@alt001.com>.
+                */
+               t.tv_sec = 999999;
+               t.tv_usec = 0;
+
                event_add_to_select_args(winbind_event_context(), &now,
                                         &r_fds, &w_fds, &t, &maxfd);
                tp = get_timed_events_timeout(winbind_event_context(), &t);
                event_add_to_select_args(winbind_event_context(), &now,
                                         &r_fds, &w_fds, &t, &maxfd);
                tp = get_timed_events_timeout(winbind_event_context(), &t);