Pointless allocating 0 bytes and then copying 0 bytes to it

tgt should be set to NULL