ptr.option = "leasefile";
ptr.o = NULL;
- if (uci_lookup_ptr(uci, &ptr, NULL, true))
+ if (uci_lookup_ptr(uci, &ptr, NULL, true) || ptr.o == NULL)
continue;
if (ptr.o->type != UCI_TYPE_STRING)
ptr.option = "ip";
ptr.o = NULL;
- if (uci_lookup_ptr(uci, &ptr, NULL, true))
+ if (uci_lookup_ptr(uci, &ptr, NULL, true) || ptr.o == NULL)
continue;
if (ptr.o->type != UCI_TYPE_STRING)
ptr.option = "name";
ptr.o = NULL;
- if (!uci_lookup_ptr(uci, &ptr, NULL, true) &&
+ if (!uci_lookup_ptr(uci, &ptr, NULL, true) && ptr.o != NULL &&
ptr.o->type == UCI_TYPE_STRING)
n = ptr.o->v.string;
else
ptr.option = "mac";
ptr.o = NULL;
- if (uci_lookup_ptr(uci, &ptr, NULL, true))
+ if (uci_lookup_ptr(uci, &ptr, NULL, true) || ptr.o == NULL)
continue;
if (ptr.o->type == UCI_TYPE_STRING) {