This here is a little bit cryptic.
You null out locAttr if it is the same value as targetAttr->name ...
To avoid something, I imagine.

Perhaps a comment?