From ede06b75aa874ecb18d84e0ad51a760f9051f06c Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sun, 1 Aug 2021 13:08:14 +0800 Subject: [PATCH] Hotfix/sangshuduo/td 3197 taosdemo coverity scan for master (#7099) * [TD-3197]: taosdemo and taosdump coverity scan issues. * exit if read sample file failed. * fix converity scan issue. * fix coverity scan issue. * fix coverity scan memory leak. * fix resource leak reported by coverity scan. Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 0a97402bdb..773506c5ae 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -6163,6 +6163,7 @@ static int32_t prepareStbStmt( if (0 != ret) { errorPrint("%s() LN%d, stmt_bind_param() failed! reason: %s\n", __func__, __LINE__, taos_stmt_errstr(stmt)); + free(bindArray); return -1; } // if msg > 3MB, break @@ -6170,6 +6171,7 @@ static int32_t prepareStbStmt( if (0 != ret) { errorPrint("%s() LN%d, stmt_add_batch() failed! reason: %s\n", __func__, __LINE__, taos_stmt_errstr(stmt)); + free(bindArray); return -1; } -- GitLab