core: double free in bus_timer_set_transient_property

Introduced in 3e3c5a4571. CID #1384233.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-01-04 11:19:55 +01:00
parent 1893972894
commit 1330648562

View file

@ -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;