diff --git a/libfreerdp/crypto/base64.c b/libfreerdp/crypto/base64.c index a6bd33609..a2a23c41b 100644 --- a/libfreerdp/crypto/base64.c +++ b/libfreerdp/crypto/base64.c @@ -307,7 +307,6 @@ static INLINE char* base64_encode_ex(const BYTE* WINPR_RESTRICT alphabet, BOOL crLf, size_t lineSize) { int c = 0; - char* ret = NULL; size_t blocks = 0; size_t outLen = (length + 3) * 4 / 3; size_t extra = 0; @@ -319,10 +318,12 @@ static INLINE char* base64_encode_ex(const BYTE* WINPR_RESTRICT alphabet, size_t outCounter = 0; const BYTE* q = data; - BYTE* p = ret = malloc(outLen + extra + 1ull); + BYTE* p = malloc(outLen + extra + 1ull); if (!p) return NULL; + char* ret = (char*)p; + /* b1, b2, b3 are input bytes * * 0 1 2