From 25b518989b5acb90872897b64523fcc9e9ef8c97 Mon Sep 17 00:00:00 2001 From: ldy Date: Sat, 4 Jan 2025 07:13:19 +0000 Subject: [PATCH] update services/updater_binary/update_partitions.cpp. Signed-off-by: ldy --- services/updater_binary/update_partitions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/updater_binary/update_partitions.cpp b/services/updater_binary/update_partitions.cpp index 4dd76aea..b200a450 100644 --- a/services/updater_binary/update_partitions.cpp +++ b/services/updater_binary/update_partitions.cpp @@ -132,6 +132,12 @@ int UpdatePartitions::ParsePartitionInfo(const std::string &partitionInfo, Parti int UpdatePartitions::DoNewPartitions(PartitonList &newPartList) { int ret = DoPartitions(newPartList); + for (auto &partition : newPartList) { + if (paritition != nullptr) { + free(paritition); + paritition = nullptr; + } + }; newPartList.clear(); if (ret <= 0) { LOG(INFO) << "do_partitions FAIL "; -- Gitee