From 3afe4cc45899d61dd0436116f9fdecbadc341796 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 1 Jul 2020 18:58:22 +0800 Subject: [PATCH] fix invalid read --- src/query/src/qExecutor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index c8207cb986..f33d739ba1 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6032,12 +6032,15 @@ void qDestroyQueryInfo(qinfo_t qHandle) { qDebug("QInfo:%p dec refCount, value:%d", pQInfo, ref); if (ref == 0) { - if (pQInfo->fn != NULL) { - assert(pQInfo->param != NULL); - pQInfo->fn(pQInfo->param); - } + _qinfo_free_fn_t fn = pQInfo->fn; + void* param = pQInfo->param; doDestoryQueryInfo(pQInfo); + if (fn != NULL) { + assert(param != NULL); + fn(param); + } + } }