diff --git a/dmtree/tr181/dhcpv4.c b/dmtree/tr181/dhcpv4.c index ed9c988f..e1cc1c2d 100644 --- a/dmtree/tr181/dhcpv4.c +++ b/dmtree/tr181/dhcpv4.c @@ -2855,6 +2855,9 @@ static int interface_get_ipv4(const char *iface, uint32_t *addr, unsigned *bits) json_object *jobj; jobj = dmjson_select_obj_in_array_idx(res, 0, 1, "ipv4-address"); + if (jobj == NULL) + return -1; + json_object_object_foreach(jobj, key, val) { if (!strcmp(key, "address")) addr_str = json_object_get_string(val);