vlist_add() expects key to point a persistent memory as it doesn't make
its copy. Passing blob_attr of current message was resulting in
undefined/random behavior including list corruption and possible
crashes.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
strcpy(_name, devname);
device->target = __target;
strcpy(__target, target);
- vlist_add(&devices, &device->node, blobmsg_get_string(data[MOUNT_DEVICE]));
+ vlist_add(&devices, &device->node, device->name);
}
vlist_flush(&devices);