[How To] Unbind an action from the input component

Actually your second example has a similar and even worse problem than the first. Since you are storing a pointer to the FInputActionBinding, but the actual value pointed to is in the list of action bindings. When an element is removed from the list, it may (and probably will) shift elements in memory to fill the now free space in the list, thereby making you pointer invalid (point to the wrong thing, or invalid memory). Generally it is very unsafe to store a reference or pointer to an element in contained in any kind of dynamic memory container such as a list. When elements are added to the list, the list may allocate entirely new memory for the entire list and move everything over (this is how dynamic memory works), so in this case all your pointers would become invalid and not just some. This creates extremely difficult to debug memory errors that don’t seem to make sense.