if (!strcmp(allowed_auto_mounts[i].token, token))
break;
- if (strcmp("shmounts:", allowed_auto_mounts[i].token) == 0
- && strncmp("shmounts:", token, sizeof("shmounts:") - 1) == 0) {
+ if (strcmp("shmounts:", allowed_auto_mounts[i].token) == 0 &&
+ strncmp("shmounts:", token, sizeof("shmounts:") - 1) == 0) {
is_shmounts = true;
break;
}
lxc_conf->auto_mounts |= allowed_auto_mounts[i].flag;
if (is_shmounts) {
lxc_conf->shmount.path_host = strdup(token + (sizeof("shmounts:") - 1));
+ if (!lxc_conf->shmount.path_host) {
+ SYSERROR("Failed to copy shmounts host path");
+ break;
+ }
+
if (strcmp(lxc_conf->shmount.path_host, "") == 0) {
ERROR("Invalid shmounts path: empty");
break;
}
+
lxc_conf->shmount.path_cont = strdup("/dev/.lxc-mounts");
+ if(!lxc_conf->shmount.path_cont) {
+ SYSERROR("Failed to copy shmounts container path");
+ break;
+ }
}
}