You're welcome.
And the reason my way was better is because doing this is a memory leak:
Code:
int foo() {
void* data = allocate_data();
if (bar)
return;
use_data(data);
}
After you return in the condition, there no longer exists any way to get a hold of the allocated memory. Thus, it can never be free'd.
In the case of the affect array in your code, this is later added to the character, so it is freed when the character is extracted. But if you skip out before the assignment, but after the allocation, the memory is lost.