Fixed struct free function generator