From: <mar...@us...> - 2007-01-31 08:16:51
|
Revision: 9950 http://svn.sourceforge.net/gphoto/?rev=9950&view=rev Author: marcusmeissner Date: 2007-01-31 00:16:52 -0800 (Wed, 31 Jan 2007) Log Message: ----------- added malloc return value check Modified Paths: -------------- trunk/gphoto2/gphoto2/actions.c Modified: trunk/gphoto2/gphoto2/actions.c =================================================================== --- trunk/gphoto2/gphoto2/actions.c 2007-01-31 03:36:49 UTC (rev 9949) +++ trunk/gphoto2/gphoto2/actions.c 2007-01-31 08:16:52 UTC (rev 9950) @@ -1217,11 +1217,12 @@ n = gp_widget_count_children (widget); newprefix = malloc(strlen(prefix)+1+strlen(uselabel)+1); + if (!newprefix) /* we will likely die now anyway */ + return; sprintf(newprefix,"%s/%s",prefix,uselabel); - if ((type != GP_WIDGET_WINDOW) && (type != GP_WIDGET_SECTION)) { + if ((type != GP_WIDGET_WINDOW) && (type != GP_WIDGET_SECTION)) printf("%s\n",newprefix); - } for (i=0; i<n; i++) { CameraWidget *child; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |