diff --git a/chunk.c b/chunk.c index 9f3d52f..0df393a 100644 --- a/chunk.c +++ b/chunk.c @@ -2404,8 +2404,10 @@ int _dmalloc_chunk_free(const char *file, const unsigned int line, #if ALLOW_FREE_NULL == 0 dmalloc_errno = DMALLOC_ERROR_IS_NULL; -#endif return FREE_ERROR; +#else + return FREE_NOERROR; +#endif } update_p = skip_update; diff --git a/dmalloc_t.c b/dmalloc_t.c index 192877a..821e493 100644 --- a/dmalloc_t.c +++ b/dmalloc_t.c @@ -1897,8 +1897,13 @@ static int check_special(void) #endif /* now test the dmalloc_free function */ +#if ALLOW_FREE_NULL + if (dmalloc_free(__FILE__, __LINE__, NULL, + DMALLOC_FUNC_FREE) != FREE_NOERROR) { +#else if (dmalloc_free(__FILE__, __LINE__, NULL, DMALLOC_FUNC_FREE) != FREE_ERROR) { +#endif if (! silent_b) { loc_printf(" ERROR: free of NULL should have failed.\n"); }