Error: global leak detected: result

This commit should fix an error. "global leak detected: result"