old fix had leak; backport actual fix from cPecan
old fix had leak; backport actual fix from cPecan

benedictpaten/cactus,benedictpaten/cactus,benedictpaten/cactus,benedictpaten/cactus,benedictpaten/cactus