Oh is there still something wrong with this? It solves my heap corruption problem fine (after decoding the payload).