summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 17:59:21 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-04-18 17:59:21 +0000
commit9a8d732a133670e8944bff0b8aabaa3d6606b72a (patch)
tree8c5ce3efffbd1bba1dd26302751d96fea73c823d /src
parenta66aae880c04355eac54f27fdb4c3e2a993e5f6e (diff)
downloadtinyproxy-9a8d732a133670e8944bff0b8aabaa3d6606b72a.tar.gz
tinyproxy-9a8d732a133670e8944bff0b8aabaa3d6606b72a.zip
Changed all calls to strdup to safestrdup. This should provide better
memory usage tracking.
Diffstat (limited to 'src')
-rw-r--r--src/acl.c4
-rw-r--r--src/filter.c6
-rw-r--r--src/tinyproxy.c4
-rw-r--r--src/utils.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/acl.c b/src/acl.c
index fe7bee8..3815775 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -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;
diff --git a/src/filter.c b/src/filter.c
index a580ebc..51bba80 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -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';
diff --git a/src/tinyproxy.c b/src/tinyproxy.c
index 7968d76..cf778ff 100644
--- a/src/tinyproxy.c
+++ b/src/tinyproxy.c
@@ -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",
diff --git a/src/utils.c b/src/utils.c
index ebaef19..aa5eed0 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -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;