diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-25 09:52:16 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-04-25 09:52:16 +0000 |
commit | 1ee66f376b6ba32cca8fb72b746174c674fc94f4 (patch) | |
tree | ab7107edc478ce2222626ea043d480963665d6fb | |
parent | 8b02407d93810de79cf62e7aee38e725912d63db (diff) |
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
-rw-r--r-- | include/inspircd.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<typename T> inline std::string ConvToStr(const T &in) { |