summaryrefslogtreecommitdiffstats
path: root/instance.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-09-04 14:46:49 +0200
committerJohn Crispin <blogic@openwrt.org>2013-09-13 17:35:55 +0200
commit72c21573149f77c4afa41afb0f5216c2ab1555ea (patch)
tree6257ebfb344f8826b49bea2bdbd713ac56885804 /instance.c
parent11a65fae34ee7900453c079eb80755f135395258 (diff)
downloadunitd-72c21573149f77c4afa41afb0f5216c2ab1555ea.tar
unitd-72c21573149f77c4afa41afb0f5216c2ab1555ea.zip
fix a bug in the trigger handling code
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'instance.c')
-rw-r--r--instance.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/instance.c b/instance.c
index e6fc331..4230d0d 100644
--- a/instance.c
+++ b/instance.c
@@ -339,10 +339,10 @@ instance_config_parse(struct service_instance *in)
in->respawn_retry = vals[2];
}
if (tb[INSTANCE_ATTR_TRIGGER]) {
- in->trigger = malloc(blob_len(tb[INSTANCE_ATTR_TRIGGER]));
+ in->trigger = malloc(blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
if (!in->trigger)
return -1;
- memcpy(in->trigger, tb[INSTANCE_ATTR_TRIGGER], blob_len(tb[INSTANCE_ATTR_TRIGGER]));
+ memcpy(in->trigger, tb[INSTANCE_ATTR_TRIGGER], blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
trigger_add(in->trigger, in);
}