start: remove stack allocations

parent 6421783a
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#endif #endif
#include <alloca.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
...@@ -67,6 +66,7 @@ ...@@ -67,6 +66,7 @@
#include "lxcseccomp.h" #include "lxcseccomp.h"
#include "macro.h" #include "macro.h"
#include "mainloop.h" #include "mainloop.h"
#include "memory_utils.h"
#include "monitor.h" #include "monitor.h"
#include "namespace.h" #include "namespace.h"
#include "network.h" #include "network.h"
...@@ -97,16 +97,13 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler, ...@@ -97,16 +97,13 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
static void print_top_failing_dir(const char *path) static void print_top_failing_dir(const char *path)
{ {
__do_free char *copy;
int ret; int ret;
size_t len; char *e, *p, saved;
char *copy, *e, *p, saved;
len = strlen(path);
copy = alloca(len + 1);
(void)strlcpy(copy, path, len + 1);
copy = must_copy_string(path);
p = copy; p = copy;
e = copy + len; e = copy + strlen(path);
while (p < e) { while (p < e) {
while (p < e && *p == '/') while (p < e && *p == '/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment