Fixed #2776 (false negative: usage of unitialized pointer (closedir))