Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
#include "lvm.h"
#include "lxc.h"
#include "lxclock.h"
+#include "memory_utils.h"
#include "namespace.h"
#include "nbd.h"
#include "overlay.h"
/* -B lvm,dir */
if (strchr(type, ',')) {
- char *dup, *token;
+ __do_free char *dup;
+ char *token;
size_t len;
- len = strlen(type);
- dup = alloca(len + 1);
- (void)strlcpy(dup, type, len + 1);
-
+ dup = must_copy_string(type);
lxc_iterate_parts(token, dup, ",") {
bdev = do_storage_create(dest, token, cname, specs);
if (bdev)