mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
node_device: fix memory leak in nodeDeviceSysfsGetSCSIHostCaps
@tmp is leaked after the second call to virVHBAGetConfig within virVHBAIsVportCapable code block because it wasn't freed after making the first call to the function. Signed-off-by: Yi Wang <wang.yi59@zte.com.cn> Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
9f4c39f309
commit
d190424105
@ -95,8 +95,9 @@ nodeDeviceSysfsGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(tmp = virVHBAGetConfig(NULL, scsi_host->host,
|
||||
"npiv_vports_inuse"))) {
|
||||
VIR_FREE(tmp);
|
||||
if (!(tmp = virVHBAGetConfig(NULL, scsi_host->host,
|
||||
"npiv_vports_inuse"))) {
|
||||
VIR_WARN("Failed to read npiv_vports_inuse for host%d",
|
||||
scsi_host->host);
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user