Re: [PATCH 3/4] VIR_FREE: Avoid doing side work in callees

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

 



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@xxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]