Fix memory leaks on error path.

1 file changed