GI-800: fixing memory leak.