Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
#include "log.h"
#include "lxclock.h"
#include "mainloop.h"
+#include "memory_utils.h"
#include "start.h"
#include "syscall_wrappers.h"
#include "terminal.h"
static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal)
{
+ __do_free char *tmp = NULL;
int ret;
size_t len;
- char *tmp;
if (!terminal->log_path || terminal->log_rotate == 0)
return -EOPNOTSUPP;
return -EBADF;
len = strlen(terminal->log_path) + sizeof(".1");
- tmp = alloca(len);
+ tmp = must_realloc(NULL, len);
ret = snprintf(tmp, len, "%s.1", terminal->log_path);
if (ret < 0 || (size_t)ret >= len)