Fixing 2 memory leaks that Guy spotted, where the paramater to
authorjongfoster <jongfoster@users.sourceforge.net>
Mon, 24 Sep 2001 21:09:24 +0000 (21:09 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Mon, 24 Sep 2001 21:09:24 +0000 (21:09 +0000)
enlist() was not being free()d.

parsers.c

index 538a0f2..f9a8841 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.27 2001/09/20 15:45:25 steudten Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.28 2001/09/22 16:32:28 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -41,6 +41,9 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.27 2001/09/20 15:45:25 steudten E
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.28  2001/09/22 16:32:28  jongfoster
+ *    Removing unused #includes.
+ *
  *    Revision 1.27  2001/09/20 15:45:25  steudten
  *
  *    add casting from size_t to int for printf()
@@ -236,13 +239,13 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.27 2001/09/20 15:45:25 steudten E
 
 #include "config.h"
 
-#ifndef _WIN32\r
+#ifndef _WIN32
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
 #include <ctype.h>
-#endif\r
-\r
+#endif
+
 #include <string.h>
 
 #ifndef _WIN32
@@ -1266,6 +1269,7 @@ void client_x_forwarded_adder(struct client_state *csp)
    log_error(LOG_LEVEL_HEADER, "addh: %s", p);
    enlist(csp->headers, p);
 
+   freez(p);
 }
 
 
@@ -1286,8 +1290,7 @@ void client_x_forwarded_adder(struct client_state *csp)
  *********************************************************************/
 void connection_close_adder(struct client_state *csp)
 {
-   enlist(csp->headers, strdup("Connection: close"));
-
+   enlist(csp->headers, "Connection: close");
 }
 
 
@@ -1347,7 +1350,9 @@ char *client_host(const struct parsers *v, const char *s, struct client_state *c
    char *cleanhost = strdup(s);
  
    if(csp->force)
+   {
       strclean(cleanhost, FORCE_PREFIX);
+   }
  
    return(cleanhost);
 }