Skip to content

Commit fc8e11b

Browse files
author
Tor Didriksen
committed
Bug#36428465 gcc warnings on possibly uninitialized field
Building RelWithDebInfo and linking with LTO we got Wmaybe-uninitialized warnings when linking mysqld. Change-Id: I2ef697a7140e91d9e80f12f35f3fba19047a7665
1 parent 4b1e90d commit fc8e11b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sql/strfunc.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,11 @@ LEX_STRING *make_lex_string_root(MEM_ROOT *mem_root, const char *str,
333333

334334
bool lex_string_strmake(MEM_ROOT *mem_root, LEX_STRING *lex_str,
335335
const char *str, size_t length) {
336-
if (!(lex_str->str = strmake_root(mem_root, str, length))) return true;
336+
lex_str->str = strmake_root(mem_root, str, length);
337+
if (lex_str->str == nullptr) {
338+
lex_str->length = 0;
339+
return true;
340+
}
337341
lex_str->length = length;
338342
return false;
339343
}

0 commit comments

Comments
 (0)