This is an automated email from Gerrit.

Andreas Fritiofson ([email protected]) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/1666

-- gerrit

commit ce5675e28984cfe70df94fc233d1520bb5f6da72
Author: Andreas Fritiofson <[email protected]>
Date:   Sat Sep 28 16:29:50 2013 +0200

    jtag/tcl: Remove no-op free
    
    And use calloc instead of malloc+memset.
    
    Change-Id: Icc1ed6e34904972bb5d3728307dcae5c55b32fc3
    Signed-off-by: Andreas Fritiofson <[email protected]>

diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index 227222e..fb060f9 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -1120,17 +1120,12 @@ COMMAND_HANDLER(handle_irscan_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       size_t fields_len = sizeof(struct scan_field) * num_fields;
-       fields = malloc(fields_len);
-       memset(fields, 0, fields_len);
+       fields = calloc(num_fields, sizeof(*fields));
 
        int retval;
        for (i = 0; i < num_fields; i++) {
                tap = jtag_tap_by_string(CMD_ARGV[i*2]);
                if (tap == NULL) {
-                       int j;
-                       for (j = 0; j < i; j++)
-                               free((void *)fields[j].out_value);
                        free(fields);
                        command_print(CMD_CTX, "Tap: %s unknown", 
CMD_ARGV[i*2]);
 

-- 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to