diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-05-04 04:35:10 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-05-04 04:35:10 +0000 |
commit | ac88af1f712485642fc868cef505dbb46403a48d (patch) | |
tree | f59359059000d4329b2fc47027dea8aa2263166e | |
parent | 65115c75c87338ec49068b0e81c4edae4d66366a (diff) | |
download | tinyproxy-ac88af1f712485642fc868cef505dbb46403a48d.tar.gz tinyproxy-ac88af1f712485642fc868cef505dbb46403a48d.zip |
Fixed a bug that would kill a child process because of an invalid
safefree() call. Basically, destroy_conn() was trying to free memory
not allocated by malloc. [Fix by David T. Pierson]
-rw-r--r-- | src/conns.c | 4 | ||||
-rw-r--r-- | src/conns.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/conns.c b/src/conns.c index 8a0e038..6015eff 100644 --- a/src/conns.c +++ b/src/conns.c @@ -1,4 +1,4 @@ -/* $Id: conns.c,v 1.15 2003-04-16 16:37:59 rjkaes Exp $ +/* $Id: conns.c,v 1.16 2003-05-04 04:35:10 rjkaes Exp $ * * Create and free the connection structure. One day there could be * other connection related tasks put here, but for now the header @@ -116,7 +116,7 @@ destroy_conn(struct conn_s *connptr) if (connptr->error_variables) { int i; - for(i = 0; connptr->error_variables[i]; i++) { + for (i = 0; i < connptr->error_variable_count; ++i) { safefree(connptr->error_variables[i]->error_key); safefree(connptr->error_variables[i]->error_val); safefree(connptr->error_variables[i]); diff --git a/src/conns.h b/src/conns.h index 6e803d3..a2c9017 100644 --- a/src/conns.h +++ b/src/conns.h @@ -1,4 +1,4 @@ -/* $Id: conns.h,v 1.13 2003-04-16 16:37:58 rjkaes Exp $ +/* $Id: conns.h,v 1.14 2003-05-04 04:35:10 rjkaes Exp $ * * See 'conns.c' for a detailed description. * @@ -40,8 +40,7 @@ struct conn_s { /* * Store the error response if there is one. * This structure stores key -> value mappings for substitution - * in the error HTML files. a NULL pointer indicates the end of - * the array + * in the error HTML files. */ struct error_variable_s { char *error_key; |