catch accesses to deleted objects

double delete bug fixed


sql/sql_list.h:
  catch accesses to deleted objects
sql/sql_union.cc:
  double delete fixed
This commit is contained in:
unknown 2004-01-30 08:09:42 +01:00
parent a2d67665d5
commit 14ede384fe
2 changed files with 9 additions and 2 deletions

View File

@ -21,6 +21,12 @@
/* mysql standard class memoryallocator */
#ifdef PEDANTIC_SAFEMALLOC
#define TRASH(XX,YY) bfill((XX), (YY), 0x8F)
#else
#define TRASH(XX,YY) /* no-op */
#endif
class Sql_alloc
{
public:
@ -34,8 +40,8 @@ public:
}
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr, size_t size) {} /*lint -e715 */
static void operator delete[](void *ptr, size_t size) {}
static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); }
static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); }
#ifdef HAVE_purify
bool dummy;
inline Sql_alloc() :dummy(0) {}

View File

@ -445,6 +445,7 @@ int st_select_lex_unit::cleanup()
if (union_result)
{
delete union_result;
union_result=0; // Safety
if (table)
free_tmp_table(thd, table);
table= 0; // Safety