diff options
Diffstat (limited to 'ubusd_proto.c')
-rw-r--r-- | ubusd_proto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ubusd_proto.c b/ubusd_proto.c index 2d04b5a..4dd89dd 100644 --- a/ubusd_proto.c +++ b/ubusd_proto.c @@ -519,12 +519,12 @@ free: void ubusd_proto_free_client(struct ubus_client *cl) { - struct ubus_object *obj; + struct ubus_object *obj, *tmp; - while (!list_empty(&cl->objects)) { - obj = list_first_entry(&cl->objects, struct ubus_object, list); + list_for_each_entry_safe(obj, tmp, &cl->objects, list) { ubusd_free_object(obj); } + ubus_msg_free(cl->retmsg); blob_buf_free(&cl->b); |