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/5380

-- gerrit

commit 104c501f947caa31033fa446bdb21be0a45971f1
Author: Tomas Vanek <[email protected]>
Date:   Fri Dec 20 23:48:46 2019 +0100

    target/semihosting_common: fix minor memory leak
    
    Reported by clang static analyzer.
    
    Change-Id: Ie663f49d92588c0d8b502cfdd8fc34004b308066
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c
index ce6a791..a41f8e4 100644
--- a/src/target/semihosting_common.c
+++ b/src/target/semihosting_common.c
@@ -944,6 +944,8 @@ int semihosting_common(struct target *target)
                                        uint8_t *fn1 = malloc(len1+1);
                                        uint8_t *fn2 = malloc(len2+1);
                                        if (!fn1 || !fn2) {
+                                               free(fn1);
+                                               free(fn2);
                                                semihosting->result = -1;
                                                semihosting->sys_errno = ENOMEM;
                                        } else {

-- 


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

Reply via email to