This is an automated email from Gerrit.

"Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>" just uploaded a new patch 
set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8762

-- gerrit

commit c9d6bb83664ad6c799e2d105efffba10d4440650
Author: Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>
Date:   Fri Feb 14 19:30:55 2025 +0300

    rtos/linux: handle OOM in `linux_gdb_thread_packet()`
    
    Change-Id: Id1b758a1edbae3d71d625d1992579b99720d77d6
    Signed-off-by: Evgeniy Naydanov <evgeniy.nayda...@syntacore.com>

diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 5467988f3e..91d9a39f24 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1040,6 +1040,10 @@ static int linux_gdb_thread_packet(struct target *target,
                return ERROR_TARGET_FAILURE;
 
        char *out_str = calloc(MAX_THREADS * 17 + 10, 1);
+       if (!out_str) {
+               LOG_ERROR("Out of memory");
+               return ERROR_FAIL;
+       }
        char *tmp_str = out_str;
        tmp_str += sprintf(tmp_str, "m");
        struct threads *temp = linux_os->thread_list;

-- 

Reply via email to