X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=service%2Fservice.c;h=c566bc70bf2d9a6a2969cc62bdcd32ad3850cc80;hp=3fc84245280cf158f9773416d8d3828dfa538c85;hb=c80009a5f56550483c1f1f0b4fdae9c040abd0ae;hpb=695c2196d7fcdf8ac7b63e755e108755ce85ce3b 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); }