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

Side by Side Diff: src/libmtp.c

Issue 12047095: Fix a leak in libmtp's LIBMTP_Release_Device(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libmtp/
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « patches/17_fix_leak_in_libmtp_release_device.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * \file libmtp.c 2 * \file libmtp.c
3 * 3 *
4 * Copyright (C) 2005-2011 Linus Walleij <triad@df.lth.se> 4 * Copyright (C) 2005-2011 Linus Walleij <triad@df.lth.se>
5 * Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com> 5 * Copyright (C) 2005-2008 Richard A. Low <richard@wentnet.com>
6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com> 6 * Copyright (C) 2007 Ted Bullock <tbullock@canada.com>
7 * Copyright (C) 2007 Tero Saarni <tero.saarni@gmail.com> 7 * Copyright (C) 2007 Tero Saarni <tero.saarni@gmail.com>
8 * Copyright (C) 2008 Florent Mertens <flomertens@gmail.com> 8 * Copyright (C) 2008 Florent Mertens <flomertens@gmail.com>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo; 2350 PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo;
2351 2351
2352 close_device(ptp_usb, params); 2352 close_device(ptp_usb, params);
2353 // Clear error stack 2353 // Clear error stack
2354 LIBMTP_Clear_Errorstack(device); 2354 LIBMTP_Clear_Errorstack(device);
2355 // Free iconv() converters... 2355 // Free iconv() converters...
2356 iconv_close(params->cd_locale_to_ucs2); 2356 iconv_close(params->cd_locale_to_ucs2);
2357 iconv_close(params->cd_ucs2_to_locale); 2357 iconv_close(params->cd_ucs2_to_locale);
2358 free(ptp_usb); 2358 free(ptp_usb);
2359 ptp_free_params(params); 2359 ptp_free_params(params);
2360 free(params);
2360 free_storage_list(device); 2361 free_storage_list(device);
2361 // Free extension list... 2362 // Free extension list...
2362 if (device->extensions != NULL) { 2363 if (device->extensions != NULL) {
2363 LIBMTP_device_extension_t *tmp = device->extensions; 2364 LIBMTP_device_extension_t *tmp = device->extensions;
2364 2365
2365 while (tmp != NULL) { 2366 while (tmp != NULL) {
2366 LIBMTP_device_extension_t *next = tmp->next; 2367 LIBMTP_device_extension_t *next = tmp->next;
2367 2368
2368 if (tmp->name) 2369 if (tmp->name)
2369 free(tmp->name); 2370 free(tmp->name);
(...skipping 6576 matching lines...) Expand 10 before | Expand all | Expand 10 after
8946 * @param device the device which may have a cache to which the object should be updated. 8947 * @param device the device which may have a cache to which the object should be updated.
8947 * @param object_id the object to update. 8948 * @param object_id the object to update.
8948 */ 8949 */
8949 static void update_metadata_cache(LIBMTP_mtpdevice_t *device, uint32_t object_id ) 8950 static void update_metadata_cache(LIBMTP_mtpdevice_t *device, uint32_t object_id )
8950 { 8951 {
8951 PTPParams *params = (PTPParams *)device->params; 8952 PTPParams *params = (PTPParams *)device->params;
8952 8953
8953 ptp_remove_object_from_cache(params, object_id); 8954 ptp_remove_object_from_cache(params, object_id);
8954 add_object_to_cache(device, object_id); 8955 add_object_to_cache(device, object_id);
8955 } 8956 }
OLDNEW
« no previous file with comments | « patches/17_fix_leak_in_libmtp_release_device.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698