Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: patches/16_fix_leaks.patch

Issue 2345493002: Uprev libmtp to 1.1.12 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Re-upload cl Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « patches/14_libusb1_header.patch ('k') | patches/17_fix_leak_in_libmtp_release_device.patch » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patches/16_fix_leaks.patch
diff --git a/patches/16_fix_leaks.patch b/patches/16_fix_leaks.patch
deleted file mode 100644
index 073457061f03ba7f9dc4935c9db15b2ed7ea2bd5..0000000000000000000000000000000000000000
--- a/patches/16_fix_leaks.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-Index: src/libmtp.c
-===================================================================
---- src/libmtp.c (revision 178434)
-+++ src/libmtp.c (working copy)
-@@ -1778,6 +1778,8 @@
- char *minorstr = strndup(element + i + 1, strlen(element) - i - 1);
- major = atoi(majorstr);
- minor = atoi(minorstr);
-+ free(majorstr);
-+ free(minorstr);
- extension = malloc(sizeof(LIBMTP_device_extension_t));
- extension->name = name;
- extension->major = major;
-Index: src/libusb1-glue.c
-===================================================================
---- src/libusb1-glue.c (revision 178434)
-+++ src/libusb1-glue.c (working copy)
-@@ -541,6 +541,7 @@
- }
- }
- }
-+ libusb_free_device_list (devs, 0);
-
- /* If nothing was found we end up here. */
- if(*mtp_device_list == NULL) {
-@@ -969,8 +970,10 @@
- }
- }
- int getfunc_ret = handler->getfunc(NULL, handler->priv,towrite,bytes,&towrite);
-- if (getfunc_ret != PTP_RC_OK)
-+ if (getfunc_ret != PTP_RC_OK) {
-+ free(bytes);
- return getfunc_ret;
-+ }
- while (usbwritten < towrite) {
- ret = USB_BULK_WRITE(ptp_usb->handle,
- ptp_usb->outep,
-@@ -982,6 +985,7 @@
- LIBMTP_USB_DEBUG("USB OUT==>\n");
-
- if (ret != LIBUSB_SUCCESS) {
-+ free(bytes);
- return PTP_ERROR_IO;
- }
- LIBMTP_USB_DATA(bytes+usbwritten, xwritten, 16);
-@@ -1004,6 +1008,7 @@
- ptp_usb->current_transfer_total,
- ptp_usb->current_transfer_callback_data);
- if (ret != 0) {
-+ free(bytes);
- return PTP_ERROR_CANCEL;
- }
- }
-@@ -2036,6 +2041,7 @@
- /* Attempt to initialize this device */
- if (init_ptp_usb(params, ptp_usb, ldevice) < 0) {
- LIBMTP_ERROR("LIBMTP PANIC: Unable to initialize device\n");
-+ libusb_free_device_list (devs, 0);
- return LIBMTP_ERROR_CONNECTING;
- }
-
-@@ -2051,12 +2057,14 @@
-
- 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);
- return LIBMTP_ERROR_CONNECTING;
- }
-
- /* Device has been reset, try again */
- 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);
- return LIBMTP_ERROR_CONNECTING;
- }
- }
-@@ -2073,11 +2081,13 @@
- "(Return code %d)\n Try to reset the device.\n",
- ret);
- libusb_release_interface(ptp_usb->handle, ptp_usb->interface);
-+ libusb_free_device_list (devs, 0);
- return LIBMTP_ERROR_CONNECTING;
- }
-
- /* OK configured properly */
- *usbinfo = (void *) ptp_usb;
-+ libusb_free_device_list (devs, 0);
- return LIBMTP_ERROR_NONE;
- }
-
« no previous file with comments | « patches/14_libusb1_header.patch ('k') | patches/17_fix_leak_in_libmtp_release_device.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698