From 44e0ee9fc275da28301f5d38b6daa408fad51a18 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 28 Mar 2020 12:31:09 +0800 Subject: [PATCH] fix base64 memory leak in httpAuth.c --- src/modules/http/src/httpAuth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/http/src/httpAuth.c b/src/modules/http/src/httpAuth.c index 4503accc0a..1ba11aba09 100644 --- a/src/modules/http/src/httpAuth.c +++ b/src/modules/http/src/httpAuth.c @@ -75,6 +75,8 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) { unsigned char *base64 = base64_decode(token, len, &outlen); if (base64 == NULL || outlen == 0) { httpError("context:%p, fd:%d, ip:%s, taosd token:%s parsed error", pContext, pContext->fd, pContext->ipstr, token); + if (base64) + free(base64); return false; } if (outlen != (TSDB_USER_LEN + TSDB_PASSWORD_LEN)) { -- GitLab