From 1ee66f376b6ba32cca8fb72b746174c674fc94f4 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 25 Apr 2006 09:52:16 +0000 Subject: Check for NULL, set pointers to NULL after deletion git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3908 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspircd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/inspircd.h b/include/inspircd.h index 7d6e3803e..726d77533 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -42,7 +42,7 @@ */ #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) ) -#define DELETE(x) { log(DEBUG,"%s:%d: delete()",__FILE__,__LINE__); delete x; } +#define DELETE(x) { log(DEBUG,"%s:%d: delete()",__FILE__,__LINE__); if (x) { delete x; x = NULL; } else log(DEBUG,"Attempt to delete NULL pointer!"); } template inline std::string ConvToStr(const T &in) { -- cgit v1.2.3