From 0371b0ef3225f7d6015d10eced24572cf12e83c2 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 30 May 2022 16:32:05 +0800 Subject: [PATCH] [CP] [xa][fix] avoid use null pointer when fail to alloc memory --- src/storage/transaction/ob_trans_sche_ctx.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storage/transaction/ob_trans_sche_ctx.cpp b/src/storage/transaction/ob_trans_sche_ctx.cpp index d7aab8a48f..107a389c74 100644 --- a/src/storage/transaction/ob_trans_sche_ctx.cpp +++ b/src/storage/transaction/ob_trans_sche_ctx.cpp @@ -3506,6 +3506,7 @@ int ObScheTransCtx::save_trans_desc_(const ObTransDesc& trans_desc) void* ptr = NULL; if (OB_UNLIKELY(NULL == (ptr = ob_malloc(sizeof(ObTransDesc), "ObScheTransCtx")))) { ret = OB_ALLOCATE_MEMORY_FAILED; + TRANS_LOG(WARN, "fail to alloc memory", K(ret), K(*this)); } else { trans_desc_ = new (ptr) ObTransDesc; } -- GitLab