Improved octo_carry_rehash, fixing memory leak and missing malloc check.