diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-04-01 16:41:33 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-04-01 16:41:33 +0000 |
commit | bcf25dc67ed85b23eb9d99b31709e8eef733cb6e (patch) | |
tree | f9db8f3026cb09dc2e1154364398988df191ac7a | |
parent | 7cd19206cc565225d6c68ad52693cc60e7344c9c (diff) | |
download | tinyproxy-bcf25dc67ed85b23eb9d99b31709e8eef733cb6e.tar.gz tinyproxy-bcf25dc67ed85b23eb9d99b31709e8eef733cb6e.zip |
(add_error_variable): Test whether connptr->error_variable is NULL,
and if so call safemalloc(). This is needed since saferealloc() will
assert() if the first argument is a NULL pointer.
Diffstat (limited to '')
-rw-r--r-- | src/htmlerror.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/htmlerror.c b/src/htmlerror.c index f069be2..008ac2f 100644 --- a/src/htmlerror.c +++ b/src/htmlerror.c @@ -1,4 +1,4 @@ -/* $Id: htmlerror.c,v 1.3 2003-03-14 22:49:03 rjkaes Exp $ +/* $Id: htmlerror.c,v 1.4 2003-04-01 16:41:33 rjkaes Exp $ * * This file contains source code for the handling and display of * HTML error pages with variable substitution. @@ -201,7 +201,11 @@ add_error_variable(struct conn_s *connptr, char *key, char *val) connptr->error_variable_count++; /* Add space for a new pointer to the error_variables structure. */ - connptr->error_variables = saferealloc(connptr->error_variables, sizeof(struct error_variable_s *) * connptr->error_variable_count); + if (!connptr->error_variables) + connptr->error_variables = safemalloc(sizeof(struct error_variables_s *) * connptr->error_variable_count); + else + connptr->error_variables = saferealloc(connptr->error_variables, sizeof(struct error_variable_s *) * connptr->error_variable_count); + if(!connptr->error_variables) return(-1); |