fix the bug of reload_ssl_config that will cause memory leak
This commit is contained in:
committed by
ob-robot
parent
7c0cb37616
commit
45bb61f6ad
7
deps/easy/src/io/easy_ssl.c
vendored
7
deps/easy/src/io/easy_ssl.c
vendored
@ -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) {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user