--- main/logger.c 2011-02-11 10:49:55.000000000 +0100 +++ main/logger.c 2011-02-11 10:49:47.000000000 +0100 @@ -393,12 +393,13 @@ AST_RWLIST_INSERT_HEAD(&logchannels, chan, list); global_logmask |= chan->logmask; } - if (qlog) { - char tmp[4096]; + + if (qlog) fclose(qlog); - snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name); - qlog = fopen(tmp, "a"); - } + + char tmp[4096]; + snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name); + qlog = fopen(tmp, "a"); if (!locked) { AST_RWLIST_UNLOCK(&logchannels);