From 1330648562c6924f846b869cc40125776fcd4e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Jan 2018 11:19:55 +0100 Subject: [PATCH] core: double free in bus_timer_set_transient_property Introduced in 3e3c5a4571d. CID #1384233. --- src/core/dbus-timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 900ed369ddd..1eedf217fe2 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -373,10 +373,8 @@ static int bus_timer_set_transient_property( unit_write_settingf(u, flags|UNIT_ESCAPE_SPECIFIERS, name, "%s=%s", name, str); v = new0(TimerValue, 1); - if (!v) { - calendar_spec_free(c); + if (!v) return -ENOMEM; - } v->base = TIMER_CALENDAR; v->calendar_spec = c;