Hi, This version fixes the cstr leak and explicitly frees tmp when allocating cookies fails. Freeing tmp also means we don't need to free *cookies when ret is less than zero. I've also formatted the name properly, so it'll show up as a new thread. Thanks in advance.