diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-06-22 01:56:16 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-06-22 01:56:16 +0000 |
commit | 1cce779d7723da5dc1ad68b5f7715e6ea3bfb0b8 (patch) | |
tree | 3930ede6826f6d14f322d206e27776907d5f50b7 /source3 | |
parent | 024250d6cab02185771c7c5c010a7873b8bf91df (diff) | |
download | samba-1cce779d7723da5dc1ad68b5f7715e6ea3bfb0b8.tar.gz samba-1cce779d7723da5dc1ad68b5f7715e6ea3bfb0b8.tar.bz2 samba-1cce779d7723da5dc1ad68b5f7715e6ea3bfb0b8.zip |
the BAD_PTR idea in talloc.h is actually a bad idea - it means callers have no way of telling if the call really failed
(This used to be commit 7a96ca313e2f6b5ad8a713babd3cac0bbcc4c399)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/talloc.h | 6 | ||||
-rw-r--r-- | source3/lib/talloc.c | 8 |
2 files changed, 1 insertions, 13 deletions
diff --git a/source3/include/talloc.h b/source3/include/talloc.h index a4df28c8b0..89c2f82e05 100644 --- a/source3/include/talloc.h +++ b/source3/include/talloc.h @@ -21,12 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef DEBUG_TALLOC -#define BAD_PTR (void*)0xdeadbeef -#else -#define BAD_PTR NULL -#endif - struct talloc_chunk { struct talloc_chunk *next; size_t size; diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c index 4c263ec4d6..85dd7b5b12 100644 --- a/source3/lib/talloc.c +++ b/source3/lib/talloc.c @@ -55,13 +55,7 @@ void *talloc(TALLOC_CTX *t, size_t size) void *p; struct talloc_chunk *tc; - if (size == 0) { - /* debugging value used to track down - memory problems. BAD_PTR is defined - in talloc.h */ - p = BAD_PTR; - return p; - } + if (size == 0) return NULL; p = malloc(size); if (!p) return p; |