diff --git a/services/updater_binary/update_partitions.cpp b/services/updater_binary/update_partitions.cpp index 4dd76aea1e5c0be5863df6d9e40cd68130e6f1fd..b200a450d067cdab64f9064cdbfd6134c4247bfd 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 ";