- blob_for_each_attr(cur, b.head, rem) {
- struct cache_type *t = malloc(sizeof(struct cache_type));
-
- if (!t)
- continue;
- t->avl.key = t->key = strdup(blobmsg_name(cur));
- t->val = strdup(blobmsg_get_string(cur));
- avl_insert(&types, &t->avl);
- }
+ blob_for_each_attr(cur, b.head, rem)
+ kvlist_set(&types, blobmsg_name(cur), blobmsg_get_string(cur));