From c9022762fb22e147b03a6a9045757f5876afd318 Mon Sep 17 00:00:00 2001 From: jongfoster Date: Mon, 24 Sep 2001 21:09:24 +0000 Subject: [PATCH] Fixing 2 memory leaks that Guy spotted, where the paramater to enlist() was not being free()d. --- parsers.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/parsers.c b/parsers.c index 538a0f25..f9a88410 100644 --- 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 +#ifndef _WIN32 #include #include #include #include -#endif - +#endif + #include #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); } -- 2.49.0