This is an automated email from Gerrit.

"Antonio Borneo <[email protected]>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9373

-- gerrit

commit a230c9d955b1e7aec25c28b03439ab2f3ceb3ef8
Author: Antonio Borneo <[email protected]>
Date:   Sun Jan 4 17:37:30 2026 +0100

    target: arm_tpiu_swo: fix memory leak on add_service() failure
    
    When add_service() fails, the caller has to free() the private
    data.
    
    Add the missing free().
    
    Change-Id: I998782ad3a2612dd289e269e889a3c6912fd8461
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index afdd8ce919..715b1c962c 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -739,6 +739,7 @@ COMMAND_HANDLER(handle_arm_tpiu_swo_enable)
                                CONNECTION_LIMIT_UNLIMITED, priv);
                        if (retval != ERROR_OK) {
                                command_print(CMD, "Can't configure trace TCP 
port %s", &obj->out_filename[1]);
+                               free(priv);
                                return retval;
                        }
                } else if (strcmp(obj->out_filename, "-")) {

-- 

Reply via email to