Fix an UAF UB (#1607)
This commit is contained in:
parent
3c03d4d160
commit
ad2ff45789
|
|
@ -248,9 +248,8 @@ bool ElfImg::findModuleBase() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (buff) free(buff);
|
||||
|
||||
if (!found) {
|
||||
if (buff) free(buff);
|
||||
LOGE("failed to read load address for %s", elf.data());
|
||||
fclose(maps);
|
||||
return false;
|
||||
|
|
@ -260,6 +259,8 @@ bool ElfImg::findModuleBase() {
|
|||
LOGE("failed to read load address for %s", elf.data());
|
||||
}
|
||||
|
||||
if (buff) free(buff);
|
||||
|
||||
fclose(maps);
|
||||
|
||||
LOGD("get module base %s: %lx", elf.data(), load_addr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue