fix memory leak and rtmp live failed