Skip to content

Commit

Permalink
avoid leak on error path
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusmeissner committed Sep 3, 2013
1 parent aa7e52c commit 1d2e4fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libgphoto2_port/usbscsi/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ gp_port_library_list (GPPortInfoList *list)
{
DIR *dir;
struct dirent *dirent;
int ret;
GPPortInfo info;
unsigned short vendor_id, product_id;

Expand All @@ -229,7 +230,9 @@ gp_port_library_list (GPPortInfoList *list)
dirent->d_name);
gp_port_info_set_path (info, path);
gp_port_info_set_name (info, _("USB Mass Storage raw SCSI"));
CHECK (gp_port_info_list_append (list, info))
ret = gp_port_info_list_append (list, info);
if (ret < GP_OK) /* can only be out of memory */
break;
}
closedir (dir);
return GP_OK;
Expand Down

0 comments on commit 1d2e4fb

Please sign in to comment.