libgltf: solve this memory leak problem on a better way

Change-Id: I6e6fbf47c216bf9151e92d5e2a5b4eee57f52989