mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
processNicRxFilterChangedEvent: Free @guestFilter and @hostFilter automatically
There's no need to call virNetDevRxFilterFree() explicitly, when corresponding variables can be declared as g_autoptr(virNetDevRxFilter). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a58da46415
commit
1eaf118ce1
@ -3817,8 +3817,8 @@ processNicRxFilterChangedEvent(virDomainObj *vm,
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
virDomainDeviceDef dev;
|
||||
virDomainNetDef *def;
|
||||
virNetDevRxFilter *guestFilter = NULL;
|
||||
virNetDevRxFilter *hostFilter = NULL;
|
||||
g_autoptr(virNetDevRxFilter) guestFilter = NULL;
|
||||
g_autoptr(virNetDevRxFilter) hostFilter = NULL;
|
||||
int ret;
|
||||
|
||||
VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s "
|
||||
@ -3826,7 +3826,7 @@ processNicRxFilterChangedEvent(virDomainObj *vm,
|
||||
devAlias, vm, vm->def->name);
|
||||
|
||||
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
return;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
VIR_DEBUG("Domain is not running");
|
||||
@ -3907,10 +3907,6 @@ processNicRxFilterChangedEvent(virDomainObj *vm,
|
||||
|
||||
endjob:
|
||||
virDomainObjEndJob(vm);
|
||||
|
||||
cleanup:
|
||||
virNetDevRxFilterFree(hostFilter);
|
||||
virNetDevRxFilterFree(guestFilter);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user