fix the bug of reload_ssl_config that will cause memory leak

This commit is contained in:
496148326@qq.com
2023-08-17 11:13:10 +00:00
committed by ob-robot
parent 7c0cb37616
commit 45bb61f6ad
2 changed files with 12 additions and 1 deletions

View File

@ -1268,6 +1268,13 @@ int easy_ssl_ob_config_check(const char *ssl_ca,
} else if ((ctx_client = easy_ssl_ctx_load(pool, ssl_ca, ssl_cert, ssl_key, ssl_enc_cert, ssl_enc_key, is_from_file, is_babassl, 0)) == NULL) {
ret = EASY_ERROR;
easy_error_log("easy_ssl_ctx_load easy_ssl_t failed");
} else {
if (NULL != ctx_server->ctx) {
SSL_CTX_free(ctx_server->ctx);
}
if (NULL != ctx_client->ctx) {
SSL_CTX_free(ctx_client->ctx);
}
}
if (pool != NULL) {

View File

@ -64,7 +64,11 @@ int FileDirectoryUtils::is_accessible(const char *file_path, bool &result)
ret = OB_INVALID_ARGUMENT;
LIB_LOG(WARN, "invalid arguments.", KCSTRING(file_path), K(ret));
} else {
result = (0 == access(file_path, R_OK) && ENOENT != errno);
if (0 == access(file_path, R_OK)) {
result = true;
} else {
LIB_LOG(WARN, "access file failed", KERRMSG, K(file_path));
}
}
return ret;
}