utils: add NULL assignment after free

This eliminates double free if next strdup fails.

refs #2147

Change-Id: Ib6f785b4401144c8fa88feb6c3244de3332e0f5e