diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-07-02 21:04:52 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-07-02 21:04:53 +0200 |
commit | 619ec82ececcbe9b9d1ca18ac6bc7c5c68c96825 (patch) | |
tree | 2c3fa06e2543e969dfd9cfb2e0b4a73e156409b4 | |
parent | c6124a1736849645b9e63f1f8e5c6565e637f06e (diff) | |
download | unitd-619ec82ececcbe9b9d1ca18ac6bc7c5c68c96825.tar unitd-619ec82ececcbe9b9d1ca18ac6bc7c5c68c96825.zip |
service: fix trigger related double-free
The memdup is unnecessary, because the data is contained inside
in->config.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | service/instance.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/service/instance.c b/service/instance.c index 1f85914..2e2f413 100644 --- a/service/instance.c +++ b/service/instance.c @@ -431,9 +431,7 @@ instance_config_parse(struct service_instance *in) in->respawn_retry = vals[2]; } if (tb[INSTANCE_ATTR_TRIGGER]) { - in->trigger = blob_memdup(tb[INSTANCE_ATTR_TRIGGER]); - if (!in->trigger) - return -1; + in->trigger = tb[INSTANCE_ATTR_TRIGGER]; trigger_add(in->trigger, in); } @@ -531,7 +529,6 @@ instance_free(struct service_instance *in) uloop_timeout_cancel(&in->timeout); trigger_del(in); watch_del(in); - free(in->trigger); instance_config_cleanup(in); free(in->config); free(in); |