summaryrefslogtreecommitdiffstats
path: root/service/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'service/service.c')
-rw-r--r--service/service.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/service/service.c b/service/service.c
index 3fc8424..c566bc7 100644
--- a/service/service.c
+++ b/service/service.c
@@ -117,10 +117,9 @@ service_update(struct service *s, struct blob_attr *config, struct blob_attr **t
service_validate_del(s);
if (tb[SERVICE_SET_TRIGGER] && blobmsg_data_len(tb[SERVICE_SET_TRIGGER])) {
- s->trigger = malloc(blob_pad_len(tb[SERVICE_SET_TRIGGER]));
+ s->trigger = blob_memdup(tb[SERVICE_SET_TRIGGER]);
if (!s->trigger)
return -1;
- memcpy(s->trigger, tb[SERVICE_SET_TRIGGER], blob_pad_len(tb[SERVICE_SET_TRIGGER]));
trigger_add(s->trigger, s);
}