From ed15174abb2b8c90eea5eba67073b19bcc818d9a Mon Sep 17 00:00:00 2001 From: wxhwang Date: Wed, 25 Oct 2023 14:13:12 +0000 Subject: [PATCH] fix memory leak --- src/storage/high_availability/ob_tablet_group_restore.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/storage/high_availability/ob_tablet_group_restore.cpp b/src/storage/high_availability/ob_tablet_group_restore.cpp index c2a86964d2..c3457f00f6 100644 --- a/src/storage/high_availability/ob_tablet_group_restore.cpp +++ b/src/storage/high_availability/ob_tablet_group_restore.cpp @@ -396,7 +396,14 @@ int ObTabletGroupRestoreDagNet::start_running_for_restore_() LOG_WARN("Fail to add task", K(ret)); ret = OB_EAGAIN; } + } else { + initial_restore_dag = nullptr; } + + if (OB_NOT_NULL(initial_restore_dag) && OB_NOT_NULL(scheduler)) { + scheduler->free_dag(*initial_restore_dag); + } + return ret; }