]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix leak on OOM when creating nwfilter rule instances
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 17 Mar 2014 11:58:34 +0000 (11:58 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 17 Mar 2014 17:08:54 +0000 (17:08 +0000)
commit9f7da130f421632c1e94e4e89ae87beb1b1c0d02
treeb91c114cd8d2009edf4e2ec8a16e01927cd0e303
parente23ca83a0d844fe421187fbbbd8f0151e544b60e
Fix leak on OOM when creating nwfilter rule instances

The ebiptablesAddRuleInst method would leak an instance
of ebiptablesRuleInstPtr if it hit OOM when adding it
to the list of instances. Remove the pointless helper
method virNWFilterRuleInstAddData and just inline the
call to VIR_APPEND_ELEMENT and free the instance on
failure.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_gentech_driver.c
src/nwfilter/nwfilter_gentech_driver.h