From 920d89f81c4989908ee40bb99e41219ac5df2787 Mon Sep 17 00:00:00 2001
From: unknown <msvensson@neptunus.(none)>
Date: Wed, 6 Apr 2005 12:27:43 +0200
Subject: [PATCH] BUG#9626 Several serious errors reported by Valgrind in
 latest 5.0 bk tree  - Fixing obvious ones

sql/ha_ndbcluster.cc:
  Delete ndb object before exiting thread
---
 sql/ha_ndbcluster.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index e3f6235c62c..0668c3db7a8 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -5803,6 +5803,7 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
   {
     thd->cleanup();
     delete thd;
+    delete ndb;
     DBUG_RETURN(NULL);
   }
 
@@ -5921,6 +5922,7 @@ extern "C" pthread_handler_decl(ndb_util_thread_func,
 
   thd->cleanup();
   delete thd;
+  delete ndb;
   DBUG_PRINT("exit", ("ndb_util_thread"));
   my_thread_end();
   pthread_exit(0);
-- 
2.30.9