diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-07-31 23:42:51 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2003-07-31 23:42:51 +0000 |
commit | bc77dfb4927691f1d40018f3bf0853f24834aec8 (patch) | |
tree | 70ab9d4d56ec20f1c0c573a6c39bf72dd665ec2d /src | |
parent | 5a2af49e58e7f6134d7a93a318663dfd6fb15b35 (diff) | |
download | tinyproxy-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 'src')
-rw-r--r-- | src/heap.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); |