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

Re: [libvirt] [PATCH] virDomainNetDefParseXML: avoid leak upon multiple "filterref"



On Tue, 2010-05-18 at 08:22 -0600, Eric Blake wrote:
> On 05/18/2010 02:22 AM, Jim Meyering wrote:
> > * src/conf/domain_conf.c (virDomainNetDefParseXML): Don't leak
> > memory when parsing two or more "filterref" elements.
> > ---
> >  src/conf/domain_conf.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index 3e45f79..0c717f2 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c
> > @@ -1905,6 +1905,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
> >                  model = virXMLPropString(cur, "type");
> >              } else if (xmlStrEqual (cur->name, BAD_CAST "filterref")) {
> >                  filter = virXMLPropString(cur, "filter");
> > +                free(filterparams);
> >                  filterparams = virNWFilterParseParamAttributes(cur);
> 
> ACK.

Don't want this to be the only 'free', make it a VIR_FREE().

   Stefan


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



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