summaryrefslogtreecommitdiffstats
path: root/service/service.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-05-25 20:55:30 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-05-25 20:55:30 +0200
commitc80009a5f56550483c1f1f0b4fdae9c040abd0ae (patch)
tree424a57db5157835ca4a902d081a302eed135f328 /service/service.c
parent695c2196d7fcdf8ac7b63e755e108755ce85ce3b (diff)
downloadunitd-c80009a5f56550483c1f1f0b4fdae9c040abd0ae.tar
unitd-c80009a5f56550483c1f1f0b4fdae9c040abd0ae.zip
service: use blob_memdup()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
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);
}