提交 9588a21b 编写于 作者: J John Ferlan

test: Fix fchosttest resource leak

Commit id '666bee39' made fabric_name optional; however, if fabric name
was present, then a leak would occur.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 8729ce56
......@@ -159,6 +159,7 @@ test6(const void *data ATTRIBUTE_UNUSED)
const char *expect_wwpn = "2102001b32a9da4e";
char *wwnn = NULL;
char *wwpn = NULL;
char *fabric_wwn = NULL;
int ret = -1;
if (!(wwnn = virReadFCHost(TEST_FC_HOST_PREFIX, TEST_FC_HOST_NUM_NO_FAB,
......@@ -169,8 +170,9 @@ test6(const void *data ATTRIBUTE_UNUSED)
"port_name")))
goto cleanup;
if (virReadFCHost(TEST_FC_HOST_PREFIX, TEST_FC_HOST_NUM_NO_FAB,
"fabric_name"))
if ((fabric_wwn = virReadFCHost(TEST_FC_HOST_PREFIX,
TEST_FC_HOST_NUM_NO_FAB,
"fabric_name")))
goto cleanup;
if (STRNEQ(expect_wwnn, wwnn) ||
......@@ -181,6 +183,7 @@ test6(const void *data ATTRIBUTE_UNUSED)
cleanup:
VIR_FREE(wwnn);
VIR_FREE(wwpn);
VIR_FREE(fabric_wwn);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册