aboutsummaryrefslogtreecommitdiffstats
path: root/src/permchain.c
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2021-02-14 05:20:47 +0200
committerMartin Pärtel <martin.partel@gmail.com>2021-02-14 05:20:47 +0200
commit1369f29fd01cae5c11fa8d3cee45b44f57c89a47 (patch)
tree9195f2db6e654ee8be5a0329fcc0725b8fdbc18d /src/permchain.c
parent455eb7cae9db3dcf928ba364c0382cda8aba31ed (diff)
downloadbindfs-1369f29fd01cae5c11fa8d3cee45b44f57c89a47.tar.gz
Got rid of alloca()
Diffstat (limited to 'src/permchain.c')
-rw-r--r--src/permchain.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/permchain.c b/src/permchain.c
index a82b8a3..6b1e9e1 100644
--- a/src/permchain.c
+++ b/src/permchain.c
@@ -18,7 +18,6 @@
*/
#include "permchain.h"
-#include <alloca.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
@@ -67,7 +66,7 @@ static int add_chmod_rule_to_permchain(const char *start, const char *end,
int ret = -1;
int len = end - start;
- char *buf = alloca((len + 1) * sizeof(char));
+ char *buf = malloc((len + 1) * sizeof(char));
const char *p = buf;
enum {LHS, RHS} state = LHS;
@@ -143,6 +142,7 @@ error:
permchain_cat(pc, newpc);
else
permchain_destroy(newpc);
+ free(buf);
return ret;
}