Skip to content

Commit 5026bd6

Browse files
gburgessivandroid-build-merger
authored andcommitted
Merge "bootable: leak less memory" am: 19073f2
am: 3739574 Change-Id: If49a5e1a2d997346cc1c1fc5a8652eb033a5f1a7
2 parents 1b130a6 + 3739574 commit 5026bd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

boot_control/libboot_control.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ bool BootControl::Init() {
218218
}
219219

220220
// Note that since there isn't a module unload function this memory is leaked.
221-
misc_device_ = strdup(device.c_str());
221+
// We use `device` below sometimes, so it's not moved out of here.
222+
misc_device_ = device;
222223
initialized_ = true;
223224

224225
// Validate the loaded data, otherwise we will destroy it and re-initialize it

0 commit comments

Comments
 (0)