[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    Re: [libvirt] [PATCH 06/14] nwfilter: fix leaking of filter parameters upon error
From:       Jiri Denemark <jdenemar () redhat ! com>
Date:       2018-04-30 13:54:45
Message-ID: 20180430135445.GP1845180 () orkuz ! home
[Download RAW message or body]

On Fri, Apr 27, 2018 at 16:25:05 +0100, Daniel P. Berrang=E9 wrote:
> The filter parameters were not correctly free'd when an error hits while
> adding to the hash table.
> =

> Signed-off-by: Daniel P. Berrang=E9 <berrange@redhat.com>
> ---
>  src/nwfilter/nwfilter_gentech_driver.c | 22 ++++++----------------
>  src/nwfilter/nwfilter_gentech_driver.h |  2 +-
>  2 files changed, 7 insertions(+), 17 deletions(-)
...
> diff --git a/src/nwfilter/nwfilter_gentech_driver.h b/src/nwfilter/nwfilt=
er_gentech_driver.h
> index 67092157b8..86cc677e79 100644
> --- a/src/nwfilter/nwfilter_gentech_driver.h
> +++ b/src/nwfilter/nwfilter_gentech_driver.h
> @@ -57,7 +57,7 @@ int virNWFilterInstantiateFilterLate(virNWFilterDriverS=
tatePtr driver,
>  =

>  int virNWFilterTeardownFilter(const virDomainNetDef *net);
>  =

> -virHashTablePtr virNWFilterCreateVarHashmap(char *macaddr,
> +virHashTablePtr virNWFilterCreateVarHashmap(const char *macaddr,
>                                         const virNWFilterVarValue *value);

The alignment needs some adjustment. However, the function has no users
outside nwfilter_gentech_driver.c so a separate patch could make it
static.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic