X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fircd_alloc.h;h=237daa4681976885c37874c3a4081061ca0edc33;hb=refs%2Fheads%2Fupstream-ssl;hp=a2aa32fb195c846e81aa43ced3a0c1936ec56426;hpb=2e16676c15d100c343e4650d5671d4eca0dba797;p=ircu2.10.12-pk.git diff --git a/include/ircd_alloc.h b/include/ircd_alloc.h index a2aa32f..237daa4 100644 --- a/include/ircd_alloc.h +++ b/include/ircd_alloc.h @@ -39,7 +39,7 @@ extern void set_nomem_handler(OutOfMemoryHandler handler); /** Helper macro for zero-initialized allocations. */ #define MyCalloc(nelem, size) \ - DoMallocZero(size * nelem, "calloc", __FILE__, __LINE__) + DoMallocZero((size) * (nelem), "calloc", __FILE__, __LINE__) /** Helper macro for freeing memory. */ #define MyFree(p) \ @@ -73,7 +73,7 @@ extern void *DoRealloc(void *, size_t, const char*, int); #define DoMallocZero(size, type, file, line) \ dbg_malloc_zero(size, type, file, line) #define DoFree(p, file, line) \ - dbg_free(p, file, line) + do { dbg_free(p, file, line); (p) = 0; } while (0) #define DoRealloc(p, size, file, line) \ dbg_realloc(p, size, file, line) #endif /* defined(MDEBUG) */