error and memory leak in rule30_shift_ring