Freeing doesn't set the value to NULL - so this doesn't change a lot. If rp->targets is not NULL in the first pass, it will now just fail/crash in the second pass as rp->targets is still not NULL. I think the original logic was written with in mind that if tagset_count = 0, then we shouldn't free the tagsets.