diff freeDiameter/cnxctx.c @ 182:9ed2e3ce4434

Cleaner error handling
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 04 Feb 2010 16:19:52 +0900
parents e2dc300819b3
children 9647d92cf4fb
line wrap: on
line diff
--- a/freeDiameter/cnxctx.c	Wed Feb 03 18:41:39 2010 +0900
+++ b/freeDiameter/cnxctx.c	Thu Feb 04 16:19:52 2010 +0900
@@ -291,7 +291,7 @@
 	}
 	
 	/* Once the socket is created successfuly, prepare the remaining of the cnx */
-	CHECK_MALLOC_DO( cnx = fd_cnx_init(1), { shutdown(sock, SHUT_RDWR); return NULL; } );
+	CHECK_MALLOC_DO( cnx = fd_cnx_init(1), { shutdown(sock, SHUT_RDWR); close(sock); return NULL; } );
 	
 	cnx->cc_socket = sock;
 	cnx->cc_proto  = IPPROTO_TCP;
"Welcome to our mercurial repository"