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 <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-03-15 16:49:37 +01:00
parent fd9514f8d2
commit 4122137871

View 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"))) {