# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2007/03/21 08:40:24+01:00 tomas@whalegate.ndb.mysql.com # Bug #26825 MySQL Server Crashes in high load # - initialize to NULL, to avoid call of free on uninitialized variable # # sql/ha_ndbcluster.cc # 2007/03/21 08:40:22+01:00 tomas@whalegate.ndb.mysql.com +7 -4 # Bug #26825 MySQL Server Crashes in high load # - initialize to NULL, to avoid call of free on uninitialized variable # diff -Nru a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc --- a/sql/ha_ndbcluster.cc 2007-03-21 08:45:31 +01:00 +++ b/sql/ha_ndbcluster.cc 2007-03-21 08:45:31 +01:00 @@ -952,7 +952,7 @@ DBUG_PRINT("enter", ("m_tabname: %s, path: %s", m_tabname, path)); do { - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; uint length, pack_length; if (!(tab= dict->getTable(m_tabname))) @@ -3755,7 +3755,7 @@ if ((my_errno= build_index_list(ndb, table, ILBP_OPEN))) DBUG_RETURN(my_errno); - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; uint length, pack_length; if (readfrm(table->s->path, &data, &length) || packfrm(data, length, &pack_data, &pack_length) || @@ -4343,7 +4343,7 @@ NDBTAB tab; NDBCOL col; uint pack_length, length, i, pk_length= 0; - const void *data, *pack_data; + const void *data= NULL, *pack_data= NULL; char name2[FN_HEADLEN]; bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE); @@ -4378,8 +4378,11 @@ if (readfrm(name, &data, &length)) DBUG_RETURN(1); if (packfrm(data, length, &pack_data, &pack_length)) + { + my_free((char*)data, MYF(0)); DBUG_RETURN(2); - + } + DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length)); tab.setFrm(pack_data, pack_length); my_free((char*)data, MYF(0));