tftp.c: fix possible dereference of null pointer
connect.c: fix multiple possible dereferences of null pointers

In case the first address in the tempaddr array is NULL,
the code would previously dereference an unchecked null pointer.