This is an automated email from Gerrit.

"Erhan Kurubas <erhan.kuru...@espressif.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7006

-- gerrit

commit 29250463b99212b4c3258318fadf49620edde41e
Author: Erhan Kurubas <erhan.kuru...@espressif.com>
Date:   Sat May 28 22:31:34 2022 +0200

    telnet_server: fix valgrind error
    
    Error: Uninitialised value was created by a heap allocation
    at telnet_new_connection (telnet_server.c:227)
    
    Signed-off-by: Erhan Kurubas <erhan.kuru...@espressif.com>
    Change-Id: I698a3648be698c93a2395a718ee1ade028226995

diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index 791a1a5485..6178eee481 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -224,7 +224,7 @@ static int telnet_new_connection(struct connection 
*connection)
        struct telnet_service *telnet_service = connection->service->priv;
        int i;
 
-       telnet_connection = malloc(sizeof(struct telnet_connection));
+       telnet_connection = calloc(1, sizeof(struct telnet_connection));
 
        if (!telnet_connection) {
                LOG_ERROR("Failed to allocate telnet connection.");

-- 

Reply via email to