创建 pangu_log 时增加对函数返回值的判断,规避 wiredLB_init 初始化失败造成的 coredump

This commit is contained in:
luwenpeng
2020-11-17 13:26:22 +06:00
parent 012f4f6602
commit 1c31974b61

View File

@@ -68,6 +68,11 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
} }
log_file_upload_para=cache_evbase_parameter_new(profile, section, local_logger); log_file_upload_para=cache_evbase_parameter_new(profile, section, local_logger);
if (log_file_upload_para == NULL)
{
TFE_LOG_ERROR(local_logger, "Pangu failed to new cache evbase parameter.");
goto error_out;
}
instance->log_file_upload_instance=cache_evbase_instance_new(log_file_upload_para, local_logger); instance->log_file_upload_instance=cache_evbase_instance_new(log_file_upload_para, local_logger);
return instance; return instance;