fix:[TD-31600] Refactor error handling logic in taos_connect_internal.
This commit is contained in:
parent
852d8fccd8
commit
08031cf180
|
@ -176,15 +176,19 @@ int32_t taos_connect_internal(const char* ip, const char* user, const char* pass
|
||||||
|
|
||||||
_return:
|
_return:
|
||||||
|
|
||||||
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
|
(void)taosThreadMutexUnlock(&appInfo.mutex);
|
||||||
|
taosMemoryFreeClear(key);
|
||||||
|
return code;
|
||||||
|
} else {
|
||||||
code = taosThreadMutexUnlock(&appInfo.mutex);
|
code = taosThreadMutexUnlock(&appInfo.mutex);
|
||||||
|
taosMemoryFreeClear(key);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
tscError("failed to unlock app info, code:%s", tstrerror(TAOS_SYSTEM_ERROR(code)));
|
tscError("failed to unlock app info, code:%s", tstrerror(TAOS_SYSTEM_ERROR(code)));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFreeClear(key);
|
|
||||||
|
|
||||||
return taosConnectImpl(user, &secretEncrypt[0], localDb, NULL, NULL, *pInst, connType, pObj);
|
return taosConnectImpl(user, &secretEncrypt[0], localDb, NULL, NULL, *pInst, connType, pObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//SAppInstInfo* getAppInstInfo(const char* clusterKey) {
|
//SAppInstInfo* getAppInstInfo(const char* clusterKey) {
|
||||||
|
|
Loading…
Reference in New Issue