I strongly suspect you can just StringSetDestroy(tags) without even checking whether it's NULL, as most destroy functions check that for themselves.