Fixed a bug and added resetting
This commit is contained in:
13
src/entry.c
13
src/entry.c
@@ -431,8 +431,16 @@ Status ResetEntryDisk(const char* entry_identifier, const char* backing_identifi
|
||||
}
|
||||
|
||||
// If no backing disk is specified, use the current backing disk
|
||||
if (backing_disk_path == NULL)
|
||||
backing_disk_path = disk_info.backing_file;
|
||||
if (backing_disk_path == NULL) {
|
||||
backing_disk_path = strdup(disk_info.backing_file);
|
||||
if (backing_disk_path == NULL) {
|
||||
Log(LOG_LEVEL_ERROR, "Failed to allocate memory for the backing disk path (%s).", strerror(errno));
|
||||
|
||||
FreeDiskInfo(&disk_info);
|
||||
free(entry_disk_path);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the disk
|
||||
if (backing_disk_path != NULL)
|
||||
@@ -481,4 +489,3 @@ Status TrimEntryDisk(const char* entry_identifier) {
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user