]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virSysinfoParseX86BaseBoard: Free memory upfront if no board detected
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 9 May 2019 13:59:33 +0000 (15:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 May 2019 11:54:26 +0000 (13:54 +0200)
commitac10f838f94f0c5cc4601258b2a779dd5bcbab2a
treeaf61725eb984eb94696b26493ed632c115630734
parentc57b205ccfd30c5df27dd7ba239ca292a31ecea4
virSysinfoParseX86BaseBoard: Free memory upfront if no board detected

If no board was detected then VIR_REALLOC_N() done at the end of
the function will actually free the memory (because nborads ==
0), but @boards will be set to a non-NULL pointer. This makes it
unnecessary harder for a caller to see if any board was detected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virsysinfo.c