Re: [PATCH 2/2] networkStartNetworkVirtual: Don't leak macmap object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 13, 2018 at 11:21:45AM +0200, Michal Privoznik wrote:
> When starting network a macmap object is created (which stores
> MAC -> domain name mappings). However, if something goes wrong
> (e.g. virNetDevIPCheckIPv6Forwarding() fails) then the object is
> leaked.
>
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/network/bridge_driver.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index f92cc61e47..588b0d147d 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2453,6 +2453,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
>          goto err1;
>
>      virNetworkObjSetMacMap(obj, macmap);
> +    macmap = NULL;
>
>      /* Set bridge options */
>
> @@ -2590,6 +2591,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
>          ignore_value(virNetDevTapDelete(macTapIfName, NULL));
>          VIR_FREE(macTapIfName);
>      }
> +    virNetworkObjUnrefMacMap(obj);

Hopefully there's no occurrence of plain virObjectUnref for obj->macmap.

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux