fix: wrong check after a strdup()