conf: duplicate interface name instead of MAC provided to lookup the interface

Introduced by 6094d6ec7f.
Found by running libvirt-perl tests.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-10-20 16:01:03 +02:00
parent 89622ebfad
commit 727238de25

View File

@ -182,7 +182,7 @@ virInterfaceObjListFindByMACStringCb(void *payload,
virObjectLock(obj);
if (STRCASEEQ(obj->def->mac, data->matchStr)) {
if (VIR_STRDUP(data->macs[data->nmacs], data->matchStr) < 0) {
if (VIR_STRDUP(data->macs[data->nmacs], obj->def->name) < 0) {
data->error = true;
goto cleanup;
}