Fixed two mostly harmless mem leaks
authoroes <oes@users.sourceforge.net>
Fri, 28 Feb 2003 12:53:06 +0000 (12:53 +0000)
committeroes <oes@users.sourceforge.net>
Fri, 28 Feb 2003 12:53:06 +0000 (12:53 +0000)
jcc.c

diff --git a/jcc.c b/jcc.c
index 8bdfa81..cb81afe 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.1 2002/09/25 14:52:24 oes Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.2 2002/11/20 14:37:47 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/Attic/jcc.c,v $
@@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.1 2002/09/25 14:52:24 oes Exp $";
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.92.2.2  2002/11/20 14:37:47  oes
+ *    Fix: Head of global clients list now initialized to NULL
+ *
  *    Revision 1.92.2.1  2002/09/25 14:52:24  oes
  *    Added basic support for OPTIONS and TRACE HTTP methods:
  *     - New interceptor direct_response() added in chat().
@@ -857,6 +860,7 @@ static void chat(struct client_state *csp)
 
       log_error(LOG_LEVEL_CLF, "%s - - [%T] \" \" 400 0", csp->ip_addr_str);
 
+      free_http_request(http);
       return;
    }
 
@@ -1366,13 +1370,13 @@ static void chat(struct client_state *csp)
                    || write_socket(csp->cfd, p != NULL ? p : csp->iob->cur, csp->content_length))
                   {
                      log_error(LOG_LEVEL_ERROR, "write modified content to client failed: %E");
+                     freez(hdr);
+                     freez(p);
                      return;
                   }
 
                   freez(hdr);
-                  if (NULL != p) {
-                     freez(p);
-                  }
+                  freez(p);
                }
 
                break; /* "game over, man" */