mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
libxl: Resolve possible resource leak in dom0 maximum memory setting
If either the "if (STRPREFIX(mem_tokens[j], "max:"))" is never entered or the "if (virStrToLong_ull(mem_tokens[j] + 4, &p, 10, maxmem) < 0)" break is hit, control goes back to the outer loop processing 'cmd_tokens' and it's possible that the 'mem_tokens' would be overwritten. Found by Coverity
This commit is contained in:
parent
b2774db9c2
commit
4ab0c959e9
@ -1622,6 +1622,7 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg,
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
virStringListFree(mem_tokens);
|
||||
}
|
||||
|
||||
physmem:
|
||||
|
Loading…
x
Reference in New Issue
Block a user