summaryrefslogtreecommitdiff
path: root/src/shared/mkdir.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-17 14:43:28 +0200
committerKay Sievers <kay@vrfy.org>2012-04-17 16:05:28 +0200
commit75e37ac5b125713c5ab6e1c4a9d62cfb62948c27 (patch)
tree3639fa8edd2ff569045a7e116fa66f7590d658f7 /src/shared/mkdir.c
parentacf9b2f154fb443ea5654ea866d90556885b2e4f (diff)
mkdir: do not use alloca() in a loop
Diffstat (limited to 'src/shared/mkdir.c')
-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;