From 188f3a5bf8ff0f28e12a5977b7b21200f088aca7 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 24 Apr 2018 14:15:14 -0700 Subject: updater: Remove an unneeded strdup(). StringValue() makes a copy of the arg. Test: mmma bootable/recovery Change-Id: I1002994e7496c840aa05c785019bdeca281f467e --- updater/blockimg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index e72ddd313..e7d213a71 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1697,7 +1697,7 @@ static Value* PerformBlockImageUpdate(const char* name, State* state, for (size_t i = 0; i < cmdcount; ++i) { if (cmd_map.find(commands[i].name) != cmd_map.end()) { LOG(ERROR) << "Error: command [" << commands[i].name << "] already exists in the cmd map."; - return StringValue(strdup("")); + return StringValue(""); } cmd_map[commands[i].name] = &commands[i]; } -- cgit v1.2.3