From 4122137871cbf604451d53b0063192f8ee2592e0 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 15 Mar 2016 16:49:37 +0100 Subject: [PATCH] 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 --- src/util/virlease.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"))) {