From 34053d039d46463e579c378c2efba44df76cc11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=AE=A3=E6=AD=A3?= Date: Mon, 15 Mar 2021 17:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Efix(hos=5Fclient.cpp):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BC=BA=E5=B0=91=E7=9A=84=E5=88=A4=E7=A9=BA=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hos_client.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hos_client.cpp b/src/hos_client.cpp index e20c7230..99759d93 100644 --- a/src/hos_client.cpp +++ b/src/hos_client.cpp @@ -156,6 +156,10 @@ static void PutObjectAsyncFinished(const Aws::S3::S3Client* S3Client, void hos_set_cache_size(hos_client_handle client, size_t cache_size) { + if (client == NULL) + { + return; + } client->cache_size = cache_size; hos_cache = (size_t *)calloc(client->thread_sum, sizeof(size_t)); return ; @@ -163,12 +167,20 @@ void hos_set_cache_size(hos_client_handle client, size_t cache_size) void hos_set_cache_count(hos_client_handle client, size_t cache_count) { + if (client == NULL) + { + return; + } client->cache_count = cache_count; return ; } void hos_set_thread_sum(hos_client_handle client, size_t thread_sum) { + if (client == NULL) + { + return; + } client->thread_sum = thread_sum; for (size_t i = 0; i < thread_sum; i++) {