Extract from queue first. Use free for (char *) returned from 'strdup'.