[libvirt] [PATCH] Fix leak of iterator in nwfilter instantiate code

Martin Kletzander mkletzan at redhat.com
Mon Mar 17 12:36:15 UTC 2014


On Mon, Mar 17, 2014 at 12:33:24PM +0000, Daniel P. Berrange wrote:
> On Mon, Mar 17, 2014 at 11:40:39AM +0000, Daniel P. Berrange wrote:
> > The ebiptablesCreateRuleInstanceIterate creates a
> > virNWFilterVarCombIterPtr instance and iterates over
> > it. Unfortunately in doing so, it discards the original
> > pointer. At the end of the method it will thus effectively
> > do virNWFilterVarCombIterFree(NULL), which means it will
> > leak the iterator.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> > ---
> >  src/nwfilter/nwfilter_ebiptables_driver.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> Opps, this is wrong. The virNWFilterVarCombIterNext method
> will bizarely  free its input parameter at the end. I'll
> send a different patch to give this saner semantics.
> 

Haven't noticed it in the review, sorry, disregard that ACK then :(

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140317/5fc36b12/attachment-0001.sig>


More information about the libvir-list mailing list