From 3c07ac2469bfcf5bb782c0123792d9186f832598 Mon Sep 17 00:00:00 2001 From: Flole998 Date: Wed, 2 Nov 2022 12:18:32 +0100 Subject: [PATCH] Network: Fix re-declaration of variable in smaller scope Like this another variable is created and used within that if-block. The original final_msg stays NULL and sendto will always fail. --- src/network/networksocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/networksocket.c b/src/network/networksocket.c index bc3c8fb..3d9ec75 100644 --- a/src/network/networksocket.c +++ b/src/network/networksocket.c @@ -148,7 +148,7 @@ int send_string(char *msg, bool is_enc) { } size_t b64_max_len = B64_ENCODE_LEN(gcrypt_len); - char* final_msg = dawn_malloc(b64_max_len); + final_msg = dawn_malloc(b64_max_len); if (!final_msg) { dawnlog_error("sendto() error: not enough memory\n"); dawn_free(gcrypt_buf);