The args struct is reused to attempt opening an URL with different stream layers, overwriting args->url not only breaks this but also causes the freed buffer to be used again.