From: <mar...@us...> - 2011-11-11 18:26:50
|
Revision: 13765 http://gphoto.svn.sourceforge.net/gphoto/?rev=13765&view=rev Author: marcusmeissner Date: 2011-11-11 18:26:44 +0000 (Fri, 11 Nov 2011) Log Message: ----------- free some structures Modified Paths: -------------- trunk/libgphoto2/libgphoto2_port/libusb1/libusb1.c Modified: trunk/libgphoto2/libgphoto2_port/libusb1/libusb1.c =================================================================== --- trunk/libgphoto2/libgphoto2_port/libusb1/libusb1.c 2011-11-07 20:21:20 UTC (rev 13764) +++ trunk/libgphoto2/libgphoto2_port/libusb1/libusb1.c 2011-11-11 18:26:44 UTC (rev 13765) @@ -158,6 +158,7 @@ continue; unknownint++; } + libusb_free_config_descriptor (config); } /* when we find only hids, printer or comm ifaces ... skip this */ if (!unknownint) @@ -221,6 +222,7 @@ continue; unknownint++; } + libusb_free_config_descriptor (config); } /* when we find only hids, printer or comm ifaces ... skip this */ if (!unknownint) @@ -699,10 +701,12 @@ for (i = 0; i < intf->bNumEndpoints; i++) { if ((intf->endpoint[i].bEndpointAddress & LIBUSB_ENDPOINT_DIR_MASK) == direction && - (intf->endpoint[i].bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == type) + (intf->endpoint[i].bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) == type) { + libusb_free_config_descriptor (confdesc); return intf->endpoint[i].bEndpointAddress; + } } - + libusb_free_config_descriptor (confdesc); return -1; } @@ -730,9 +734,11 @@ *config = i; *interface = i1; *altsetting = i2; + libusb_free_config_descriptor (confdesc); return 0; } + libusb_free_config_descriptor (confdesc); } return -1; } @@ -830,7 +836,7 @@ confdesc->interface[interface].altsetting[altsetting].bInterfaceClass, confdesc->interface[interface].altsetting[altsetting].bInterfaceSubClass ); - + libusb_free_config_descriptor (confdesc); return GP_OK; } #if 0 @@ -1012,6 +1018,7 @@ struct libusb_config_descriptor *config; ret = libusb_get_config_descriptor (dev, i, &config); + if (ret != LIBUSB_SUCCESS) continue; for (i1 = 0; i1 < config->bNumInterfaces; i1++) { const struct libusb_interface *interface = @@ -1030,12 +1037,13 @@ *interfaceno = i1; *altsettingno = i2; + libusb_free_config_descriptor (config); return 2; } } } + libusb_free_config_descriptor (config); } - return 0; } @@ -1123,6 +1131,7 @@ port->settings.usb.outep, port->settings.usb.intep ); + libusb_free_config_descriptor (confdesc); return GP_OK; } #if 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |