mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
5ec2b0cca5
Problem is, localtime_r() returns a pointer to converted time or NULL in case of an error. But checking the glibc sources, error will occur iff a NULL has been passed as an either of arguments the function takes. But GCC fails to see that: ../../tools/virsh-network.c: In function 'cmdNetworkDHCPLeases': ../../tools/virsh-network.c:1370:12: error: potential null pointer dereference [-Werror=null-dereference] ts = *localtime_r(&expirytime_tmp, &ts); ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Michal Privoznik <mprivozn@redhat.com>