Skip to content

Commit 3739574

Browse files
gburgessivandroid-build-merger
authored andcommitted
Merge "bootable: leak less memory"
am: 19073f2 Change-Id: I55463429524f54941b47fce9f0c318ae47993414
2 parents a5d8357 + 19073f2 commit 3739574

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)