From: Stefan Knoblich Date: Wed, 22 Apr 2009 23:34:48 +0000 (+0000) Subject: Do not use struct fd_set uninitialized (always FD_ZERO() them, before using FD_SET... X-Git-Tag: v1.0.4~1072 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0193119a5e6a675b5a0329abc49e442c01b004a5;p=thirdparty%2Ffreeswitch.git Do not use struct fd_set uninitialized (always FD_ZERO() them, before using FD_SET() on a new one, or reusing them after select()). Fixes a segfault on solaris git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13125 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_log.c b/src/switch_log.c index 9d2fd62d1c..3f65ef7ceb 100644 --- a/src/switch_log.c +++ b/src/switch_log.c @@ -332,6 +332,7 @@ SWITCH_DECLARE(void) switch_log_vprintf(switch_text_channel_t channel, const cha fd = fileno(handle); memset(&to, 0, sizeof(to)); + FD_ZERO(&can_write); FD_SET(fd, &can_write); to.tv_sec = 0; to.tv_usec = 100000;