diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index 5f1e7a7a9431f4e6a16b7f61981a42aa36042fcf..4f9f03f17935cf54ad79ac52ff51a6fd9c942b15 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -132,7 +132,7 @@ static int32_t dnodeOpenVnodes() { char vnodeDir[TSDB_FILENAME_LEN * 3]; int32_t failed = 0; - int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * 10000); + int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * TSDB_MAX_VNODES); int32_t numOfVnodes = dnodeGetVnodeList(vnodeList); for (int32_t i = 0; i < numOfVnodes; ++i) { @@ -147,7 +147,7 @@ static int32_t dnodeOpenVnodes() { } static void dnodeCloseVnodes() { - int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * 10000); + int32_t *vnodeList = (int32_t *)malloc(sizeof(int32_t) * TSDB_MAX_VNODES); int32_t numOfVnodes = dnodeGetVnodeList(vnodeList); for (int32_t i = 0; i < numOfVnodes; ++i) {