changeset 870:028350cb60b1 trunk

[svn] - in C++, using __null/NULL is improper. 0 should be used instead. - guard against double-deletes
author nenolod
date Fri, 16 Mar 2007 21:13:22 -0700
parents 48ebfc711a8c
children f51f658b8e9c
files ChangeLog src/adplug/core/rol.cxx
diffstat 2 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 16 21:08:34 2007 -0700
+++ b/ChangeLog	Fri Mar 16 21:13:22 2007 -0700
@@ -1,3 +1,17 @@
+2007-03-17 04:08:34 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1838]
+  - guard some potentially improper double delete [] usage
+  
+  trunk/src/adplug/core/a2m.cxx     |   18 ++++++++++++------
+  trunk/src/adplug/core/adl.cxx     |    4 ++--
+  trunk/src/adplug/core/sng.h       |    4 ++--
+  trunk/src/adplug/core/temuopl.cxx |    2 +-
+  trunk/src/adplug/core/u6m.cxx     |    4 ++--
+  trunk/src/adplug/core/xad.cxx     |    3 +--
+  trunk/src/adplug/core/xsm.cxx     |    2 +-
+  7 files changed, 21 insertions(+), 16 deletions(-)
+
+
 2007-03-17 01:58:17 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1836]
   - fix double delete[] possibility.
--- a/src/adplug/core/rol.cxx	Fri Mar 16 21:08:34 2007 -0700
+++ b/src/adplug/core/rol.cxx	Fri Mar 16 21:13:22 2007 -0700
@@ -84,10 +84,10 @@
 //---------------------------------------------------------
 CrolPlayer::~CrolPlayer()
 {
-    if( rol_header != NULL )
+    if(rol_header)
     {
         delete rol_header;
-        rol_header=NULL;
+        rol_header = 0;
     }
 }
 //---------------------------------------------------------
@@ -107,7 +107,7 @@
 	break;
     strcpy(fn+i+1,"standard.bnk");
     bnk_filename = fn;
-    delete [] fn;
+    delete [] fn; fn = 0;
     AdPlug_LogWrite("bnk_filename = \"%s\"\n",bnk_filename.c_str());
 
     rol_header = new SRolHeader;