This is an automated email from Gerrit.

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

-- gerrit

commit 49abc3be9cfdb9cc069e6613a3c38f872f05aad7
Author: Tomas Vanek <[email protected]>
Date:   Fri Dec 20 23:34:19 2019 +0100

    jtag/drivers/ulink: fix clang static analyzer warnings
    
    Change-Id: I967c07af19e9020c93bcb4ef403cf1f557dd1db1
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c
index bbe08aa..01976e5 100644
--- a/src/jtag/drivers/ulink.c
+++ b/src/jtag/drivers/ulink.c
@@ -663,12 +663,16 @@ int ulink_append_queue(struct ulink *device, struct 
ulink_cmd *ulink_cmd)
                /* New command does not fit. Execute all commands in queue 
before starting
                 * new queue with the current command as first entry. */
                ret = ulink_execute_queued_commands(device, USB_TIMEOUT);
-               if (ret != ERROR_OK)
+               if (ret != ERROR_OK) {
+                       free(ulink_cmd);
                        return ret;
+               }
 
                ret = ulink_post_process_queue(device);
-               if (ret != ERROR_OK)
+               if (ret != ERROR_OK) {
+                       free(ulink_cmd);
                        return ret;
+               }
 
                ulink_clear_queue(device);
        }
@@ -1627,6 +1631,7 @@ int ulink_queue_scan(struct ulink *device, struct 
jtag_command *cmd)
 
                if (ret != ERROR_OK) {
                        free(tdi_buffer_start);
+                       free(tdo_buffer_start);
                        return ret;
                }
        }

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to