@@ -7108,14 +7108,13 @@ static int i_s_innodb_tablespaces_fill_table(THD *thd, TABLE_LIST *tables,
71087108 heap = mem_heap_create (1000 );
71097109
71107110 if (dd_access_through_server ()) {
7111- return for_all_innodb_objects_in_dd<dd::Tablespace>(
7111+ int result = for_all_innodb_objects_in_dd<dd::Tablespace>(
71127112 thd, [&heap, &tables](THD *thd, const dd::Tablespace &tablespace) {
71137113 const auto &se_private_data = tablespace.se_private_data ();
71147114
71157115 space_id_t space;
71167116 if (se_private_data.get (dd_space_key_strings[DD_SPACE_ID], &space)) {
71177117 assert (false );
7118- mem_heap_free (heap);
71197118 return 1 ;
71207119 }
71217120
@@ -7132,15 +7131,13 @@ static int i_s_innodb_tablespaces_fill_table(THD *thd, TABLE_LIST *tables,
71327131 if (se_private_data.get (dd_space_key_strings[DD_SPACE_FLAGS],
71337132 &flags)) {
71347133 assert (false );
7135- mem_heap_free (heap);
71367134 return 1 ;
71377135 }
71387136
71397137 dd::String_type encryption;
71407138 if (properties.exists (" encryption" ) &&
71417139 properties.get (" encryption" , &encryption)) {
71427140 assert (false );
7143- mem_heap_free (heap);
71447141 return 1 ;
71457142 }
71467143
@@ -7155,15 +7152,13 @@ static int i_s_innodb_tablespaces_fill_table(THD *thd, TABLE_LIST *tables,
71557152 if (se_private_data.get (dd_space_key_strings[DD_SPACE_SERVER_VERSION],
71567153 &server_version)) {
71577154 assert (false );
7158- mem_heap_free (heap);
71597155 return 1 ;
71607156 }
71617157
71627158 uint32 space_version;
71637159 if (se_private_data.get (dd_space_key_strings[DD_SPACE_VERSION],
71647160 &space_version)) {
71657161 assert (false );
7166- mem_heap_free (heap);
71677162 return 1 ;
71687163 }
71697164
@@ -7172,15 +7167,13 @@ static int i_s_innodb_tablespaces_fill_table(THD *thd, TABLE_LIST *tables,
71727167 if (se_private_data.get (dd_space_key_strings[DD_SPACE_STATE],
71737168 &state)) {
71747169 assert (false );
7175- mem_heap_free (heap);
71767170 return 1 ;
71777171 }
71787172
71797173 uint64_t autoextend_size = 0 ;
71807174 if (properties.exists (autoextend_size_str) &&
71817175 properties.get (autoextend_size_str, &autoextend_size)) {
71827176 assert (false );
7183- mem_heap_free (heap);
71847177 return 1 ;
71857178 }
71867179
@@ -7192,6 +7185,8 @@ static int i_s_innodb_tablespaces_fill_table(THD *thd, TABLE_LIST *tables,
71927185
71937186 return 0 ;
71947187 });
7188+ mem_heap_free (heap);
7189+ return result;
71957190 }
71967191
71977192 assert (!dd_access_through_server ());
0 commit comments