static char *generate_unique_filename(PTPParams* params, char const * const filename);
static int check_filename_exists(PTPParams* params, char const * const filename);
+#ifdef TIZEN_EXT
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler);
+#endif /* TIZEN_EXT */
+
/**
* These are to wrap the get/put handlers to convert from the MTP types to PTP types
* in a reliable way
}
#ifdef TIZEN_EXT
-int _is_exist_handler(int **object_list, int size, int current_handler)
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler)
{
int i;
unsigned char *bytes;
int expect_terminator_byte = 0;
unsigned long usb_inep_maxpacket_size;
- unsigned long context_block_size_1;
- unsigned long context_block_size_2;
+ unsigned long context_block_size_1 = 0;
+ unsigned long context_block_size_2 = 0;
uint16_t ptp_dev_vendor_id = ptp_usb->rawdevice.device_entry.vendor_id;
//"iRiver" device special handling
if (err) {
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
LIBMTP_ERROR("LIBMTP PANIC: Unable to find interface & endpoints of device\n");
return LIBMTP_ERROR_CONNECTING;
}
if (init_ptp_usb(params, ptp_usb, ldevice) < 0) {
LIBMTP_ERROR("LIBMTP PANIC: Unable to initialize device\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
if(init_ptp_usb(params, ptp_usb, ldevice) <0) {
LIBMTP_ERROR("LIBMTP PANIC: Could not init USB on second attempt\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
if ((ret = ptp_opensession(params, 1)) == PTP_ERROR_IO) {
LIBMTP_ERROR("LIBMTP PANIC: failed to open session on second attempt\n");
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}
}
ret);
libusb_release_interface(ptp_usb->handle, ptp_usb->interface);
libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+ free (ptp_usb);
+#endif /* TIZEN_EXT */
return LIBMTP_ERROR_CONNECTING;
}