mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
driconf: initialize the option value before using it
ParseValue is freeing the pointer if the address is != 0. However, since we allocate this value on the stack, we need to initialize the data first. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Martin Peres <martin.peres@mupuf.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>
This commit is contained in:
parent
0e3a424f00
commit
f9763b2054
1 changed files with 4 additions and 0 deletions
|
|
@ -377,6 +377,10 @@ driParseOptionInfo(driOptionCache *info,
|
|||
char *envVal = getenv(name);
|
||||
if (envVal != NULL) {
|
||||
driOptionValue v;
|
||||
|
||||
/* make sure the value is initialized to something sensible */
|
||||
v._string = NULL;
|
||||
|
||||
if (parseValue(&v, opt->info.type, envVal) &&
|
||||
checkValue(&v, optinfo)) {
|
||||
/* don't use XML_WARNING, we want the user to see this! */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue