Commit 14ede384 authored by unknown's avatar unknown

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
parent a2d67665
......@@ -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) {}
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment