Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 398365) +++ channels/chan_dahdi.c (working copy) @@ -4623,6 +4623,8 @@ { DAHDI_ALARM_NONE, "None" }, }; +static struct pollfd *pfds=NULL; + static char *alarm2str(int alm) { int x; @@ -11718,7 +11720,6 @@ time_t thispass = 0, lastpass = 0; int found; char buf[1024]; - struct pollfd *pfds=NULL; int lastalloc = -1; /* This thread monitors all the frame relay interfaces which are not yet in use (and thus do not have a separate thread) indefinitely */ @@ -16770,6 +16771,8 @@ pthread_join(monitor_thread, NULL); } monitor_thread = AST_PTHREADT_STOP; + ast_free(pfds); + pfds = NULL; ast_mutex_unlock(&monlock); destroy_all_channels();