fix failure to check malloc result in setenv