summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/usb_gadget.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/usb_gadget.h b/hw/usb_gadget.h
index f61f966..06c6ef8 100644
--- a/hw/usb_gadget.h
+++ b/hw/usb_gadget.h
@@ -127,6 +127,7 @@ static void free_simple_func(struct usb_function *func)
if (func) {
free((void *)func->name);
free((void *)func->instance);
+ free((void *)func->ffs_service);
free((void *)func->service);
free(func);
}
@@ -151,6 +152,12 @@ static int clone_simple_func(struct usb_function *func,
if (!other->name || !other->instance)
goto out_nomem;
+ if (func->ffs_service) {
+ other->ffs_service = strdup(func->ffs_service);
+ if (!other->ffs_service)
+ goto out_nomem;
+ }
+
if (func->service) {
other->service = strdup(func->service);
if (!other->service)