[td-717] fix memory leak in taosdemo.c

This commit is contained in:
Haojun Liao 2020-06-25 00:45:29 +08:00
parent 9a4414c3af
commit 1ed5309d97
1 changed files with 4 additions and 3 deletions

View File

@ -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;