Check the allocated pointer instead of the given pointer as intended