On a Friday in 2022, Peter Krempa wrote:
The return value of virXMLPropString was assigned into 'tmp'
multiple
times and to prevent static analyzers moaning about a potential leak a
short-circuited if+logic or was used.
where did the + come from?
Replace the code by having a helper variable for each possibility and
also replace the for-loop to iterate elements.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tools/virsh-domain.c | 48 +++++++++++++++++++++++---------------------
1 file changed, 25 insertions(+), 23 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano