Changed all calls to strdup to safestrdup. This should provide better
memory usage tracking.
This commit is contained in:
parent
a66aae880c
commit
9a8d732a13
@ -1,4 +1,4 @@
|
||||
/* $Id: acl.c,v 1.13 2002-04-17 20:52:45 rjkaes Exp $
|
||||
/* $Id: acl.c,v 1.14 2002-04-18 17:59:21 rjkaes Exp $
|
||||
*
|
||||
* This system handles Access Control for use of this daemon. A list of
|
||||
* domains, or IP addresses (including IP blocks) are stored in a list
|
||||
@ -120,7 +120,7 @@ insert_acl(char *location, acl_access_t access_type)
|
||||
new_acl_ptr->netmask = 32;
|
||||
}
|
||||
|
||||
new_acl_ptr->location = strdup(location);
|
||||
new_acl_ptr->location = safestrdup(location);
|
||||
if (!new_acl_ptr->location) {
|
||||
safefree(new_acl_ptr);
|
||||
return -1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: filter.c,v 1.8 2001-11-22 00:31:10 rjkaes Exp $
|
||||
/* $Id: filter.c,v 1.9 2002-04-18 17:59:21 rjkaes Exp $
|
||||
*
|
||||
* Copyright (c) 1999 George Talusan (gstalusan@uwaterloo.ca)
|
||||
*
|
||||
@ -67,7 +67,7 @@ filter_init(void)
|
||||
if (isspace((unsigned char) *s))
|
||||
*s = '\0';
|
||||
|
||||
p->pat = strdup(buf);
|
||||
p->pat = safestrdup(buf);
|
||||
p->cpat = safemalloc(sizeof(regex_t));
|
||||
if ((err =
|
||||
regcomp(p->cpat, p->pat,
|
||||
@ -114,7 +114,7 @@ filter_url(char *host)
|
||||
return (0);
|
||||
|
||||
/* strip off the port number */
|
||||
s = strdup(host);
|
||||
s = safestrdup(host);
|
||||
port = strchr(s, ':');
|
||||
if (port)
|
||||
*port = '\0';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tinyproxy.c,v 1.26 2002-04-18 17:04:04 rjkaes Exp $
|
||||
/* $Id: tinyproxy.c,v 1.27 2002-04-18 17:59:21 rjkaes Exp $
|
||||
*
|
||||
* The initialise routine. Basically sets up all the initial stuff (logfile,
|
||||
* listening socket, config options, etc.) and then sits there and loops
|
||||
@ -173,7 +173,7 @@ main(int argc, char **argv)
|
||||
godaemon = FALSE;
|
||||
break;
|
||||
case 'c':
|
||||
conf_file = strdup(optarg);
|
||||
conf_file = safestrdup(optarg);
|
||||
if (!conf_file) {
|
||||
fprintf(stderr,
|
||||
"%s: Could not allocate memory.\n",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: utils.c,v 1.27 2002-04-18 17:49:14 rjkaes Exp $
|
||||
/* $Id: utils.c,v 1.28 2002-04-18 17:59:21 rjkaes Exp $
|
||||
*
|
||||
* Misc. routines which are used by the various functions to handle strings
|
||||
* and memory allocation and pretty much anything else we can think of. Also,
|
||||
@ -198,7 +198,7 @@ send_http_error_message(struct conn_s *connptr)
|
||||
int
|
||||
indicate_http_error(struct conn_s* connptr, int number, const char* string)
|
||||
{
|
||||
connptr->error_string = strdup(string);
|
||||
connptr->error_string = safestrdup(string);
|
||||
if (!connptr->error_string)
|
||||
return -1;
|
||||
connptr->error_number = number;
|
||||
|
Loading…
Reference in New Issue
Block a user