bootable: leak less memory

`misc_device_` is a std::string, so it allocates and manages its own
memory. Hence, the strdup here is immediately leaked.

Caught by the static analyzer

Bug: None
Test: TreeHugger
Change-Id: Iffb1ff60f6087e470a0979d202150567272e8b1c
This commit is contained in:
George Burgess IV
2019-10-23 12:09:07 -07:00
parent 0d76cad830
commit 1b03fc5493
+2 -1
View File
@@ -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