util: Plug memory leak on virNetDevMacVLanCreateWithVPortProfile() error path

Detected by Coverity. Leak introduced in commit 90074ec.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Alex Jia 2011-11-30 13:57:12 +08:00 committed by Eric Blake
parent 5483e5736d
commit 4c8327994c

View File

@ -582,7 +582,10 @@ create_name:
virNetDevError(VIR_ERR_INTERNAL_ERROR, virNetDevError(VIR_ERR_INTERNAL_ERROR,
_("cannot set bandwidth limits on %s"), _("cannot set bandwidth limits on %s"),
cr_ifname); cr_ifname);
rc = -1; if (withTap)
VIR_FORCE_CLOSE(rc); /* sets rc to -1 */
else
rc = -1;
goto disassociate_exit; goto disassociate_exit;
} }