Skip to content

Commit

Permalink
MDEV-31545 GCC 13 -Wdangling-pointer in execute_show_status()
Browse files Browse the repository at this point in the history
The pointer was used deep in the call path.

Resolve this by setting the pointer to NULL at the end of
the function.

Tested with gcc-13.3.1 (fc38)

The warning disable 38fe266 can be reverted in 10.6+ on merge.
  • Loading branch information
grooverdan committed Jul 19, 2023
1 parent 4b3f930 commit fbc157a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/sql_parse.cc
Expand Up @@ -6522,9 +6522,11 @@ static bool execute_show_status(THD *thd, TABLE_LIST *all_tables)
memcpy(&thd->status_var, &old_status_var,
offsetof(STATUS_VAR, last_cleared_system_status_var));
mysql_mutex_unlock(&LOCK_status);
thd->initial_status_var= NULL;
return res;
#ifdef WITH_WSREP
wsrep_error_label: /* see WSREP_SYNC_WAIT() macro above */
thd->initial_status_var= NULL;
return true;
#endif /* WITH_WSREP */
}
Expand Down

0 comments on commit fbc157a

Please sign in to comment.