Fix static analysis issues.

- always check return values from socket related functions
- avoid doublefree in udp_cleanup() and icmp_cleanup()
- use secure string manipulation in icmp_send_error()
- always initialize addr local structure in udp_listen()
- check if lseek() fails in tftp_read_data()

Signed-off-by: Jindrich Novy <>
3 jobs for static-analysis-fixes in 1 minute and 14 seconds (queued for 1 second)