lxc_user_nic: remove stack allocations

parent 861cb8c2
......@@ -368,9 +368,11 @@ lxc_monitord_SOURCES = cmd/lxc_monitord.c \
lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
log.c log.h \
memory_utils.h \
network.c network.h \
parse.c parse.h \
raw_syscalls.c raw_syscalls.h \
string_utils.c string_utils.h \
syscall_wrappers.h
lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
conf.c conf.h \
......
......@@ -49,9 +49,11 @@
#include "config.h"
#include "log.h"
#include "memory_utils.h"
#include "network.h"
#include "parse.h"
#include "raw_syscalls.h"
#include "string_utils.h"
#include "syscall_wrappers.h"
#include "utils.h"
......@@ -838,13 +840,12 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid,
static bool create_db_dir(char *fnam)
{
int ret;
__do_free char *copy;
char *p;
size_t len;
int ret;
len = strlen(fnam);
p = alloca(len + 1);
(void)strlcpy(p, fnam, len + 1);
copy = must_copy_string(fnam);
p = copy;
fnam = p;
p = p + 1;
......
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