Made some small modifications (backing extraction)
This commit is contained in:
@@ -396,24 +396,24 @@ result_t get_backing_parent(char** _parent, const char* backing) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// If the disk is not backed, return success and a null parent
|
||||
// Free the backing path as it is not needed anymore
|
||||
free(path);
|
||||
|
||||
// Check if the disk is backed
|
||||
if (info.backing_path == NULL) {
|
||||
free_disk_info(&info);
|
||||
free(path);
|
||||
return success();
|
||||
}
|
||||
|
||||
// Get the backing identifier of the parent
|
||||
char* parent = strdup(basename(info.backing_path));
|
||||
if (parent == NULL) {
|
||||
free_disk_info(&info);
|
||||
free(path);
|
||||
return failure("Failed to get the backing identifier of the parent.");
|
||||
}
|
||||
|
||||
// Free the disk info as it is not needed anymore
|
||||
free_disk_info(&info);
|
||||
free(path);
|
||||
|
||||
if (parent == NULL)
|
||||
return failure("Failed to get the backing identifier of the parent.");
|
||||
|
||||
*_parent = parent;
|
||||
return result;
|
||||
return success();
|
||||
}
|
||||
|
Reference in New Issue
Block a user