[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v5 2/9] 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>
---
 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 b8e9d8b..910c003 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"))) {
-- 
2.4.10


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]