char *root_path;
char *dest_dir_path; /* relative to root_path */
- char *full_subvol_path;
+ char full_subvol_path[PATH_MAX];
char *full_root_path;
int dest_dir_chroot;
r->cur_subvol.path = strdup(path);
else
r->cur_subvol.path = path_cat(r->dest_dir_path, path);
- free(r->full_subvol_path);
- r->full_subvol_path = path_cat3(r->root_path, r->dest_dir_path, path);
+ ret = path_cat3_out(r->full_subvol_path, r->root_path,
+ r->dest_dir_path, path);
+ if (ret < 0) {
+ fprintf(stderr, "ERROR: subvol: path invalid: %s\n", path);
+ goto out;
+ }
fprintf(stderr, "At subvol %s\n", path);
r->cur_subvol.path = strdup(path);
else
r->cur_subvol.path = path_cat(r->dest_dir_path, path);
- free(r->full_subvol_path);
- r->full_subvol_path = path_cat3(r->root_path, r->dest_dir_path, path);
+ ret = path_cat3_out(r->full_subvol_path, r->root_path,
+ r->dest_dir_path, path);
+ if (ret < 0) {
+ fprintf(stderr, "ERROR: snapshot: path invalid: %s\n", path);
+ goto out;
+ }
fprintf(stdout, "At snapshot %s\n", path);
}
free(r->root_path);
r->root_path = NULL;
- free(r->full_subvol_path);
- r->full_subvol_path = NULL;
r->dest_dir_path = NULL;
free(dest_dir_full_path);
if (r->cur_subvol.path) {