summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-25 21:41:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-31 23:06:29 +0300
commitf0d5be2db32afc7b4382276ffa3c60a1354bea8e (patch)
tree919fc1db442339a32a88bde0fa6f68e320e64dce /src/common/socket.c
parenta71a056abb8931aa4a11d0cde296fe9de68ee6df (diff)
downloadhercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.gz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.bz2
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.tar.xz
hercules-f0d5be2db32afc7b4382276ffa3c60a1354bea8e.zip
Add some missing null pointer checks after automatic checks.
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 09521c312..c0864c9b3 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -633,14 +633,16 @@ static void delete_session(int fd)
aFree(session[fd]->wdata);
if( session[fd]->session_data )
aFree(session[fd]->session_data);
- for(i = 0; i < session[fd]->hdatac; i++) {
- if( session[fd]->hdata[i]->flag.free ) {
- aFree(session[fd]->hdata[i]->data);
- }
- aFree(session[fd]->hdata[i]);
- }
if( session[fd]->hdata )
+ {
+ for(i = 0; i < session[fd]->hdatac; i++) {
+ if( session[fd]->hdata[i]->flag.free ) {
+ aFree(session[fd]->hdata[i]->data);
+ }
+ aFree(session[fd]->hdata[i]);
+ }
aFree(session[fd]->hdata);
+ }
aFree(session[fd]);
session[fd] = NULL;
}