Update of /cvsroot/sblim/sfcb
In directory vz-cvs-3.sog:/tmp/cvs-serv30626
Modified Files:
httpComm.c
Log Message:
[ 3516184 ] commClose close socket when file hndl is null
Signed-off-by: Narasimha Sharoff <nsh...@us...>
Index: httpComm.c
===================================================================
RCS file: /cvsroot/sblim/sfcb/httpComm.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- httpComm.c 11 Apr 2012 22:55:17 -0000 1.13
+++ httpComm.c 13 Apr 2012 16:17:04 -0000 1.14
@@ -135,21 +135,22 @@
{
_SFCB_ENTER(TRACE_HTTPDAEMON, "commClose");
+ if (hndl.socket == -1) return; /* socket was closed already */
#if defined USE_SSL
if (hndl.ssl) {
if ((SSL_get_shutdown(hndl.ssl) & SSL_RECEIVED_SHUTDOWN))
SSL_shutdown(hndl.ssl);
else SSL_clear(hndl.ssl);
SSL_free(hndl.ssl);
- } else
+ }
#endif
- if (hndl.file == NULL) {
- close(hndl.socket);
- } else {
+ if (hndl.file != NULL) {
fclose(hndl.file);
if (hndl.buf) {
free(hndl.buf);
}
}
+ close(hndl.socket);
+ hndl.socket = -1;
_SFCB_EXIT();
}
|