summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shared/mkdir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
index fef674c1b3..b102af779d 100644
--- a/src/shared/mkdir.c
+++ b/src/shared/mkdir.c
@@ -84,10 +84,12 @@ int mkdir_parents(const char *path, mode_t mode) {
if (*p == 0)
return 0;
- if (!(t = strndupa(path, e - path)))
+ t = strndup(path, e - path);
+ if (!t)
return -ENOMEM;
r = label_mkdir(t, mode);
+ free(t);
if (r < 0 && errno != EEXIST)
return -errno;