News for hackers. Stuff that matters.
Re:Dirty Coding Tricks by feelix on Friday January 09, 2015 @05:24AM (#8861581)
The pointer would get freed later, but freeing a pointer does not change the pointer address. Eg: If the pointer is storing the address "10" and you free 10, the value 10 is not lost, the value 10 points to gets freed though.

Assuming the controller ID would normally point to somewhere in protected memory, the frees would have no effect, and he could store the controller ID in the pointer parameter as the address of the pointer.

Re:Dirty Coding Tricks by kruczek on Monday January 12, 2015 @04:35AM (#8873058)
But the problem would be attempting to free the pointer which points to some random memory location (the address "10") - I'd expect it to end with a segfault with a high probability.
Re:Dirty Coding Tricks by jheriko on Wednesday January 14, 2015 @11:59AM (#8887449)
i've not yet worked on a game console platform that doesn't end up in trouble when you try and free some small number. given the context of doom 3 engine i think my experience covers it well... unless they did some insane PS1 port for reasons unknown.

maybe they used a custom allocator though... its very common.