modify queue.c free bug which cause SIGSEGV