Fix memory leak.
CID: 1367751 Reviewed by: jhb
This commit is contained in:
parent
350ab5eb1e
commit
4e9bbc8ec3
@ -200,6 +200,7 @@ _kvm_read_core_phdrs(kvm_t *kd, size_t *phnump, GElf_Phdr **phdrp)
|
||||
|
||||
for (i = 0; i < phnum; i++) {
|
||||
if (gelf_getphdr(elf, i, &phdr[i]) == NULL) {
|
||||
free(phdr);
|
||||
_kvm_err(kd, kd->program, "%s", elf_errmsg(0));
|
||||
goto bad;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user