Redis C++ client, support the data slice storage, support redis cluster, thread-safe,multi-platform,connection pool, read/write separation.
GNU General Public License v3.0
337
stars
153
forks
source link
xRedisClusterClient::RedisCommandArgv接口内 FreeReply(reply) 和 RedisResult &result的析构函数导致二次释放崩溃 #43
Closed
bulingma closed 5 years ago
bool xRedisClusterClient::RedisCommandArgv(const VSTRING& vDataIn, RedisResult &result) 函数通过 RedisResult &result 参数将函数执行结果赋值给 result带出,当 FreeReply(reply); 执行后,result 中的结果则已被释放,无有效结果输出;且 RedisResult 的析构函数因为二次释放会导致崩溃。注释掉FreeReply(reply)可解决该问题:修改后代码如下:
bool xRedisClusterClient::RedisCommandArgv(const VSTRING& vDataIn, RedisResult &result){ bool bRet = false; const std::string &key = vDataIn[1]; RedisConnection *pRedisConn = FindNodeConnection(key.c_str()); if (NULL == pRedisConn) { return false; }
}