summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-10-24 02:03:38 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-10-24 02:03:38 +0200
commit19073f206708a93c2ec4f710d6c3a996dd5bdaae (patch)
tree271a8a2f73079b4d2c438cfdea0d6d68ce4b0e29
parentMerge "[bootable][recovery] fix -Wreorder-init-list" (diff)
parentbootable: leak less memory (diff)
downloadandroid_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar.gz
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar.bz2
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar.lz
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar.xz
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.tar.zst
android_bootable_recovery-19073f206708a93c2ec4f710d6c3a996dd5bdaae.zip
-rw-r--r--boot_control/libboot_control.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/boot_control/libboot_control.cpp b/boot_control/libboot_control.cpp
index e3bff9ff3..ff4eaabfa 100644
--- a/boot_control/libboot_control.cpp
+++ b/boot_control/libboot_control.cpp
@@ -218,7 +218,8 @@ bool BootControl::Init() {
}
// Note that since there isn't a module unload function this memory is leaked.
- misc_device_ = strdup(device.c_str());
+ // We use `device` below sometimes, so it's not moved out of here.
+ misc_device_ = device;
initialized_ = true;
// Validate the loaded data, otherwise we will destroy it and re-initialize it