summaryrefslogtreecommitdiffstats
path: root/src/iphone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iphone.c')
-rw-r--r--src/iphone.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/iphone.c b/src/iphone.c
index f5bc206..68963fe 100644
--- a/src/iphone.c
+++ b/src/iphone.c
@@ -140,14 +140,14 @@ iphone_error_t iphone_free_device ( iphone_device_t device ) {
if (device->buffer) {
free(device->buffer);
- if (device->device) {
- usb_release_interface(device->device, 1);
- usb_reset(device->device);
- usb_close(device->device);
- ret = IPHONE_E_SUCCESS;
- }
- free(device);
}
+ if (device->device) {
+ usb_release_interface(device->device, 1);
+ usb_reset(device->device);
+ usb_close(device->device);
+ ret = IPHONE_E_SUCCESS;
+ }
+ free(device);
return ret;
}