From 1ed5309d975bb386763c68fafe4997be99a8305a Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 25 Jun 2020 00:45:29 +0800 Subject: [PATCH] [td-717] fix memory leak in taosdemo.c --- src/kit/taosdemo/taosdemo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index e4b84fc8e8..e673277a0b 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -470,11 +470,12 @@ int main(int argc, char *argv[]) { char command[BUFFER_SIZE] = "\0"; sprintf(command, "drop database %s;", db_name); - taos_query(taos, command); - + TAOS_RES* res = taos_query(taos, command); + taos_free_result(res); sprintf(command, "create database %s;", db_name); - taos_query(taos, command); + res = taos_query(taos, command); + taos_free_result(res); char cols[STRING_LEN] = "\0"; int colIndex = 0; -- GitLab