]> xenbits.xensource.com Git - libvirt.git/commitdiff
virLeaseReadCustomLeaseFile: Allow server_duid to be NULL
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Mar 2016 15:49:37 +0000 (16:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Mar 2016 16:29:53 +0000 (17:29 +0100)
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 <mprivozn@redhat.com>
src/util/virlease.c

index b8e9d8be469ca38139298ccf64207eaa881a7ffb..910c00346b9a93bdcd2ae112b78ac8052cd215f6 100644 (file)
@@ -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"))) {