CID1130009: Resource leak in sp_opensocket()

Corresponding to flashrom svn r1775.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
diff --git a/serprog.c b/serprog.c
index 237db7d..86c67e0 100644
--- a/serprog.c
+++ b/serprog.c
@@ -100,6 +100,7 @@
 	if (NULL == hostPtr) {
 		hostPtr = gethostbyaddr(ip, strlen(ip), AF_INET);
 		if (NULL == hostPtr) {
+			close(sock);
 			msg_perr("Error: cannot resolve %s\n", ip);
 			return -1;
 		}