diff --git a/virtualization.m b/virtualization.m index 91a9b90..2b2e2b4 100644 --- a/virtualization.m +++ b/virtualization.m @@ -357,16 +357,12 @@ void setStorageDevicesVZVirtualMachineConfiguration(void *config, */ void *newVZDiskImageStorageDeviceAttachment(const char *diskPath, bool readOnly, void **error) { - VZDiskImageStorageDeviceAttachment *ret; - @autoreleasepool { - NSString *diskPathNSString = [NSString stringWithUTF8String:diskPath]; - NSURL *diskURL = [NSURL fileURLWithPath:diskPathNSString]; - ret = [[VZDiskImageStorageDeviceAttachment alloc] - initWithURL:diskURL - readOnly:(BOOL)readOnly - error:(NSError * _Nullable * _Nullable)error]; - } - return ret; + NSString *diskPathNSString = [NSString stringWithUTF8String:diskPath]; + NSURL *diskURL = [NSURL fileURLWithPath:diskPathNSString]; + return [[VZDiskImageStorageDeviceAttachment alloc] + initWithURL:diskURL + readOnly:(BOOL)readOnly + error:(NSError * _Nullable * _Nullable)error]; }