From: <mar...@us...> - 2013-09-03 07:34:01
|
Revision: 14542 http://sourceforge.net/p/gphoto/code/14542 Author: marcusmeissner Date: 2013-09-03 07:33:59 +0000 (Tue, 03 Sep 2013) Log Message: ----------- break loop on append error to avoid leaks Modified Paths: -------------- trunk/libgphoto2/libgphoto2_port/usbdiskdirect/linux.c Modified: trunk/libgphoto2/libgphoto2_port/usbdiskdirect/linux.c =================================================================== --- trunk/libgphoto2/libgphoto2_port/usbdiskdirect/linux.c 2013-09-03 07:32:39 UTC (rev 14541) +++ trunk/libgphoto2/libgphoto2_port/usbdiskdirect/linux.c 2013-09-03 07:33:59 UTC (rev 14542) @@ -207,6 +207,7 @@ DIR *dir; struct dirent *dirent; GPPortInfo info; + int ret; unsigned short vendor_id, product_id; dir = opendir ("/sys/block"); @@ -232,7 +233,9 @@ dirent->d_name); gp_port_info_set_path (info, path); gp_port_info_set_name (info, _("USB Mass Storage direct IO")); - CHECK (gp_port_info_list_append (list, info)) + ret = gp_port_info_list_append (list, info); + if (ret < GP_OK) + break; } closedir (dir); return GP_OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |