Don't check an array for existence

Closes Coverity #720389
Don't check array for existence.

Closes Coverity #720384
Check return code of dup()

Closes Coverity #720380, 81, 82