summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2003-07-31 23:42:51 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2003-07-31 23:42:51 +0000
commitbc77dfb4927691f1d40018f3bf0853f24834aec8 (patch)
tree70ab9d4d56ec20f1c0c573a6c39bf72dd665ec2d
parent5a2af49e58e7f6134d7a93a318663dfd6fb15b35 (diff)
downloadtinyproxy-bc77dfb4927691f1d40018f3bf0853f24834aec8.tar.gz
tinyproxy-bc77dfb4927691f1d40018f3bf0853f24834aec8.zip
(debugging_realloc): Removed the assert for the NULL pointer, since
realloc() can take a NULL pointer, as defined by the realloc() man page. Fixed the cast in both safefree() macros to compile cleaning using a C++ compiler.
Diffstat (limited to '')
-rw-r--r--src/heap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/heap.c b/src/heap.c
index 167147a..d8763b4 100644
--- a/src/heap.c
+++ b/src/heap.c
@@ -1,4 +1,4 @@
-/* $Id: heap.c,v 1.6 2003-06-26 18:14:13 rjkaes Exp $
+/* $Id: heap.c,v 1.7 2003-07-31 23:42:51 rjkaes Exp $
*
* Debugging versions of various heap related functions are combined
* here. The debugging versions include assertions and also print
@@ -55,7 +55,6 @@ debugging_realloc(void *ptr, size_t size, const char *file, unsigned long line)
{
void *newptr;
- assert(ptr != NULL);
assert(size > 0);
newptr = realloc(ptr, size);
@@ -83,7 +82,7 @@ debugging_strdup(const char* s, const char* file, unsigned long line)
assert(s != NULL);
len = strlen(s) + 1;
- ptr = malloc(len);
+ ptr = (char*)malloc(len);
if (!ptr)
return NULL;
memcpy(ptr, s, len);