From 619ec82ececcbe9b9d1ca18ac6bc7c5c68c96825 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 2 Jul 2014 21:04:52 +0200 Subject: service: fix trigger related double-free The memdup is unnecessary, because the data is contained inside in->config. Signed-off-by: Felix Fietkau --- service/instance.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'service') 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); -- cgit v1.2.3