cleanup: remove all dead assignments pointed out by clang-analyzer
linux: return early if we have no interfaces

This was pointed out as possible undefined allocation of 0 bytes by
clang-analyzer. `malloc` of 0 bytes can return either `NULL` or a
valid pointer which can't be dereferenced. On systems which return
`NULL`, we would consider it a `malloc` error and return an `ENOMEM` to
the caller.
cleanup: remove a dead increment pointed out by clang-analyzer