diff options
author | Kay Sievers <kay@vrfy.org> | 2012-04-17 14:43:28 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-04-17 16:05:28 +0200 |
commit | 75e37ac5b125713c5ab6e1c4a9d62cfb62948c27 (patch) | |
tree | 3639fa8edd2ff569045a7e116fa66f7590d658f7 /src/shared | |
parent | acf9b2f154fb443ea5654ea866d90556885b2e4f (diff) |
mkdir: do not use alloca() in a loop
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/mkdir.c | 4 |
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; |