diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c index a6bf46b103..a5f4abae6f 100644 --- a/tests/virpcivpdtest.c +++ b/tests/virpcivpdtest.c @@ -229,8 +229,10 @@ testPCIVPDResourceCustomCompareIndex(const void *data G_GNUC_UNUSED) /* Different index, same value pointers */ g_free(b->value); b->value = a->value; - if (virPCIVPDResourceCustomCompareIndex(b, a)) + if (virPCIVPDResourceCustomCompareIndex(b, a)) { + b->value = NULL; return -1; + } b->value = NULL;