while (1) {
char *tmp;
u64 next;
+ int add_len;
+
/*
- * ref_tree = 0 indicates the subvolumes
- * has been deleted.
- */
- if (!found->ref_tree)
+ * ref_tree = 0 indicates the subvolumes
+ * has been deleted.
+ */
+ if (!found->ref_tree) {
+ free(full_path);
return -ENOENT;
- int add_len = strlen(found->path);
+ }
+
+ add_len = strlen(found->path);
/* room for / and for null */
tmp = malloc(add_len + 2 + len);
next = found->ref_tree;
- if (next == top_id) {
+ if (next == top_id) {
ri->top_id = top_id;
break;
}
* subvolume was deleted.
*/
found = root_tree_search(rl, next);
- if (!found)
+ if (!found) {
+ free(full_path);
return -ENOENT;
+ }
}
ri->full_path = full_path;