From: Michal Privoznik Date: Tue, 15 Mar 2016 15:49:37 +0000 (+0100) Subject: virLeaseReadCustomLeaseFile: Allow server_duid to be NULL X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4122137871cbf604451d53b0063192f8ee2592e0;p=libvirt.git virLeaseReadCustomLeaseFile: Allow server_duid to be NULL This function is going to be used later in such context where the argument makes no sense. Teach this function to cope with that instead of the caller having to deal with passing some dummy argument. Signed-off-by: Michal Privoznik --- diff --git a/src/util/virlease.c b/src/util/virlease.c index b8e9d8be46..910c00346b 100644 --- a/src/util/virlease.c +++ b/src/util/virlease.c @@ -120,7 +120,7 @@ virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, continue; } - if (strchr(ip_tmp, ':')) { + if (server_duid && strchr(ip_tmp, ':')) { /* This is an ipv6 lease */ if ((server_duid_tmp = virJSONValueObjectGetString(lease_tmp, "server-duid"))) {