On 07/15/2014 02:38 PM, Michal Privoznik wrote:
There are just two places where we rely on the fact that VIR_FREE()
macro is without any side effects. In the future, this property of the
macro is going to change, so we need the code to be adjusted to deal
with argument passed to VIR_FREE() being evaluated multiple times.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/network_conf.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
NACK, this completely removes the side effect. You need to adjust the callers
for that.
IMO we should set n<elems> to 0 in all *Clear functions, not just
virNetworkDNSHostDefClear, after which NULL might be dereferenced based on the
n<elems> variable.
Jan