summaryrefslogtreecommitdiff
path: root/src/basic/calendarspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/calendarspec.c')
-rw-r--r--src/basic/calendarspec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c
index db11e55390..316db5c556 100644
--- a/src/basic/calendarspec.c
+++ b/src/basic/calendarspec.c
@@ -779,9 +779,6 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
assert(p);
assert(spec);
- if (isempty(p))
- return -EINVAL;
-
c = new0(CalendarSpec, 1);
if (!c)
return -ENOMEM;
@@ -820,6 +817,11 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
}
}
+ if (isempty(p)) {
+ r = -EINVAL;
+ goto fail;
+ }
+
if (strcaseeq(p, "minutely")) {
r = const_chain(0, &c->microsecond);
if (r < 0)