Fixed Coverity issues CID 1080742: Double free && CID 1080741: Resource leak.