summaryrefslogtreecommitdiffstats
path: root/service/instance.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/instance.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/instance.c')
-rw-r--r--service/instance.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/service/instance.c b/service/instance.c
index 1b28a7a..4a45759 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -408,10 +408,9 @@ instance_config_parse(struct service_instance *in)
in->respawn_retry = vals[2];
}
if (tb[INSTANCE_ATTR_TRIGGER]) {
- in->trigger = malloc(blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
+ in->trigger = blob_memdup(tb[INSTANCE_ATTR_TRIGGER]);
if (!in->trigger)
return -1;
- memcpy(in->trigger, tb[INSTANCE_ATTR_TRIGGER], blob_pad_len(tb[INSTANCE_ATTR_TRIGGER]));
trigger_add(in->trigger, in);
}