SQL/MySQL: properly initialize variable
Properly initialize outBinds - even it should be initialized by mysql/mariadb client lib we should correctly initialize it with 0 to avoid valgrind warnings about accessing uninitialized data. Pick-to: 6.5 6.2 5.15 Change-Id: I85b99a7e639dad9f8d24f554cd96c5997a5838ae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
6b67c3e738
commit
ed031ed18c
|
|
@ -886,9 +886,9 @@ bool QMYSQLResult::prepare(const QString& query)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (mysql_stmt_param_count(d->stmt) > 0) {// allocate memory for outvalues
|
||||
d->outBinds = new MYSQL_BIND[mysql_stmt_param_count(d->stmt)];
|
||||
}
|
||||
const auto paramCount = mysql_stmt_param_count(d->stmt);
|
||||
if (paramCount > 0) // allocate memory for outvalues
|
||||
d->outBinds = new MYSQL_BIND[paramCount]();
|
||||
|
||||
setSelect(d->bindInValues());
|
||||
d->preparedQuery = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue