summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/unit-name.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
index 4b84542d0c..fa530da456 100644
--- a/src/basic/unit-name.c
+++ b/src/basic/unit-name.c
@@ -695,8 +695,10 @@ int slice_build_parent_slice(const char *slice, char **ret) {
strcpy(dash, ".slice");
else {
r = free_and_strdup(&s, "-.slice");
- if (r < 0)
+ if (r < 0) {
+ free(s);
return r;
+ }
}
*ret = s;