Revision c935730e

View differences:

net_helper-ml.c
518 518

  
519 519
int wait4data(const struct nodeID *n, struct timeval *tout, int *fds) {
520 520

  
521
	struct event *timeout_ev;
521
	struct event *timeout_ev = NULL;
522 522
	struct event *fd_ev[FDSSIZE];
523 523
	bool fd_triggered[FDSSIZE] = { false };
524 524
	int i;
......
543 543
	}
544 544

  
545 545
	//delete one-time events
546
	event_del(timeout_ev);
547
	event_free(timeout_ev);
546
	if (timeout_ev) {
547
	  if (!timeoutFired) event_del(timeout_ev);
548
	  event_free(timeout_ev);
549
	}
548 550
	for (i = 0; fds && fds[i] != -1; i ++) {
549 551
	  if (! fd_triggered[i]) {
550 552
	    fds[i] = -2;

Also available in: Unified diff