@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>
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;