Skip to content

Commit

Permalink
MDEV-17841 fixup: GCC -Wmaybe-uninitialized
Browse files Browse the repository at this point in the history
In commit ab38b75
an added "goto err" would seemingly cause a read of
an uninitialized variable old_info if errpos>=5.

However, because we would have errpos=0 at that point,
there was no real error.
  • Loading branch information
dr-m committed Mar 17, 2022
1 parent b73d852 commit 06e3bc4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/maria/ma_open.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
Copyright (c) 2009, 2021, MariaDB Corporation Ab
Copyright (c) 2009, 2022, MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -276,7 +276,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
uchar *UNINIT_VAR(disk_cache), *disk_pos, *end_pos;
MARIA_HA info, *UNINIT_VAR(m_info), *old_info;
MARIA_HA info, *UNINIT_VAR(m_info), *old_info= NULL;
MARIA_SHARE share_buff,*share;
double *rec_per_key_part;
ulong *nulls_per_key_part;
Expand Down Expand Up @@ -327,7 +327,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
}
#endif /* WITH_S3_STORAGE_ENGINE */

old_info= 0;
if (!internal_table)
mysql_mutex_lock(&THR_LOCK_maria);
if ((open_flags & HA_OPEN_COPY) ||
Expand Down

0 comments on commit 06e3bc4

Please sign in to comment.