Update for the fix of malloc/free issue by H.Sweeten

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1262 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 17 years ago
parent a3bed685b1
commit 809980e5e2

@ -2,9 +2,9 @@
* src/cmd/cable.c, src/tap/cable/wiggler.c,
src/tap/cable/generic_usbconn.c, src/tap/cable/vision_ep9307.c,
src/tap/cable/jim.c, src/tap/cable/ft2232.c,
src/tap/cable/generic_parport.c: Cable connect/disconnect cleanup,
fix malloc/free issues (Hartley Sweeten)
src/tap/cable/jim.c, src/tap/cable/ft2232.c,
src/tap/cable/usbblaster.c, src/tap/cable/generic_parport.c: Cable
connect/disconnect cleanup, fix malloc/free issues (Hartley Sweeten)
2008-05-27 Arnim Laeuger <arniml@users.sourceforge.net>

@ -67,26 +67,24 @@ usbblaster_connect( char *params[], cable_t *cable )
params_t *cable_params;
int result;
/* perform generic_usbconn_connect */
if ( ( result = generic_usbconn_connect( params, cable ) ) != 0 )
return result;
cable_params = (params_t *)malloc( sizeof(params_t) );
if (!cable_params)
{
free( cable );
printf( _("%s(%d) malloc failed!\n"), __FILE__, __LINE__);
return 4;
}
/* perform generic_usbconn_connect */
result = generic_usbconn_connect( params, cable );
cx_cmd_init( &(cable_params->cmd_root) );
if (result == 0)
{
cx_cmd_init( &(cable_params->cmd_root) );
/* exchange generic cable parameters with our private parameter set */
free( cable->params );
cable->params = cable_params;
/* exchange generic cable parameters with our private parameter set */
free( cable->params );
cable->params = cable_params;
}
return result;
return 0;
}
static int

Loading…
Cancel
Save