From: Felix Fietkau Date: Wed, 2 Jul 2014 19:04:52 +0000 (+0200) Subject: service: fix trigger related double-free X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=619ec82ececcbe9b9d1ca18ac6bc7c5c68c96825;p=oweals%2Fprocd.git service: fix trigger related double-free The memdup is unnecessary, because the data is contained inside in->config. Signed-off-by: Felix Fietkau --- 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);