From d68367420f03b288094def88efcb0c77fb9868e4 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Wed, 28 May 2008 19:07:18 +0000 Subject: [PATCH] Fix cmd/cable.c malloc issue (Hartley Sweeten) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1257 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 +++++ jtag/src/tap/cable/generic_parport.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index c2a427ec..526e33fd 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-05-28 Kolja Waschk + + * src/tap/cable/generic_parport.c: Fix cmd/cable.c malloc issue + (Hartley Sweeten) + 2008-05-27 Arnim Laeuger * UrJTAG.txt: document progress option of svf command diff --git a/jtag/src/tap/cable/generic_parport.c b/jtag/src/tap/cable/generic_parport.c index 6fc30bab..bb549def 100644 --- a/jtag/src/tap/cable/generic_parport.c +++ b/jtag/src/tap/cable/generic_parport.c @@ -50,7 +50,7 @@ print_vector(int len, char *vec) int generic_parport_connect( char *params[], cable_t *cable ) { - generic_params_t *cable_params = malloc( sizeof *cable_params ); + generic_params_t *cable_params; parport_t *port; int i; @@ -72,11 +72,12 @@ generic_parport_connect( char *params[], cable_t *cable ) port = parport_drivers[i]->connect( (const char **) ¶ms[2], cmd_params( params ) - 2 ); - if (port == NULL) { - printf( _("Error: Cable connection failed!\n") ); - return 3; - } + if (port == NULL) { + printf( _("Error: Cable connection failed!\n") ); + return 3; + } + cable_params = malloc( sizeof *cable_params ); if (!cable_params) { free( cable_params ); free( cable );