summaryrefslogtreecommitdiffstats
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2018-05-10 14:04:30 +0200
committerDavid Tardon <dtardon@redhat.com>2018-05-10 14:04:30 +0200
commit921b59871649381def508e2646a959f0c69bd005 (patch)
tree32b0ac42f95c1c81088cb91418f46f7b6b03d49d /src/core/load-fragment.c
parentjournal: use automatic cleanup more (diff)
downloadsystemd-921b59871649381def508e2646a959f0c69bd005.tar.xz
systemd-921b59871649381def508e2646a959f0c69bd005.zip
basic: use automatic cleanup more
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index d2a4c18bb8..a78039bb4f 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1637,7 +1637,7 @@ int config_parse_timer(const char *unit,
usec_t usec = 0;
TimerValue *v;
TimerBase b;
- CalendarSpec *c = NULL;
+ _cleanup_(calendar_spec_freep) CalendarSpec *c = NULL;
Unit *u = userdata;
_cleanup_free_ char *k = NULL;
int r;
@@ -1678,14 +1678,12 @@ int config_parse_timer(const char *unit,
}
v = new0(TimerValue, 1);
- if (!v) {
- calendar_spec_free(c);
+ if (!v)
return log_oom();
- }
v->base = b;
v->value = usec;
- v->calendar_spec = c;
+ v->calendar_spec = TAKE_PTR(c);
LIST_PREPEND(value, t->values, v);