Skip to content

Commit

Permalink
fix: call taos_free_result after reference finished
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed May 31, 2023
1 parent 1014f0d commit 55f62de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/benchQuery.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ int selectAndGetResult(threadInfo *pThreadInfo, char *command) {
TAOS_RES *res = taos_query(taos, command);
int code = taos_errno(res);
if (res == NULL || code) {
taos_free_result(res);
if (YES_IF_FAILED == g_arguments->continueIfFail) {
warnPrint("failed to execute sql:%s, "
"code: 0x%08x, reason:%s\n",
Expand Down Expand Up @@ -113,7 +112,6 @@ static void *mixedQuery(void *sarg) {
TAOS_RES *res = taos_query(pThreadInfo->conn->taos,
sql->command);
if (res == NULL || taos_errno(res) != 0) {
taos_free_result(res);
if (YES_IF_FAILED == g_arguments->continueIfFail) {
warnPrint(
"thread[%d]: failed to execute sql :%s, "
Expand All @@ -130,9 +128,11 @@ static void *mixedQuery(void *sarg) {
taos_errno(res), taos_errstr(res));
if (TSDB_CODE_RPC_NETWORK_UNAVAIL ==
taos_errno(res)) {
taos_free_result(res);
return NULL;
}
}
taos_free_result(res);
continue;
}
taos_free_result(res);
Expand Down

0 comments on commit 55f62de

Please sign in to comment.